Showing posts with label facing. Show all posts
Showing posts with label facing. Show all posts

Friday, March 23, 2012

Problem with importing a CSV into database

Hi,

Presenlty Iam facing problem while trying to import a .csv file into the database.
Issue is that... I am able to achieve my functionality when i import a file from D:\
But when i run the same program... and try to import from C:\ its throwing an exception.

I am coding in VB (Visual Studio 2005 ) and database is Microsoft SQL SERVER 2005.
My project is currently running on local machine in C:\Inetpub\wwwroot

Im using the following code to query the database...

SELECT employeeid, IDCubeID, ClockTime, ClockType, CreatedDate, Status, EntryType, ' ' as Remark,YardID,YardName,' ' as UserModify,' ' as UserCreate,DateModify,JobNo FROM & File1.PostedFile.FileName.ToString

where File1.PostedFile.FileName.ToString = D:\RawData_ClockTime.csv

when i import from C drive .. (File1.PostedFile.FileName.ToString = C:\RawData_ClockTime.csv)
it is throwing an exception as follows...

The Microsoft Jet database engine could not find the object 'RawData_ClockTime.csv'. Make sure the object exists and that you spell its name and the path name correctly.Always remember that C: drive on your local machine and on your server is not the same.

Use \\machine_name\.... instead.

Good Luck.

Wednesday, March 21, 2012

Problem with HTML rendering

Hi
I'm facing a problem when i render a report in HTML format.
When i see the report in the preview section of the report designer it
is perfect as desired.
After deployment, when i export the report in HTML format there are a
lot of white spaces inserted vertically. But it doesn't happen when it
is exported in PDF format.
Please suggest some methods to overcome this problem.
Thanks in advance
PrathimaTry to place your report elements and regions in rectangles to keep them
together.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Prathima" <prathima.chandramouli@.gmail.com> wrote in message
news:f941b84.0411010245.4e3e8a9@.posting.google.com...
> Hi
> I'm facing a problem when i render a report in HTML format.
> When i see the report in the preview section of the report designer it
> is perfect as desired.
> After deployment, when i export the report in HTML format there are a
> lot of white spaces inserted vertically. But it doesn't happen when it
> is exported in PDF format.
> Please suggest some methods to overcome this problem.
> Thanks in advance
> Prathima

Monday, March 12, 2012

Problem with expression window in derived column

Hi,

i am facing problem to dervie one column value from another column using either if and case statements in expression window of dervived columns transformation.

let me give the exapmle. i get 1 column from source system name as "col a" and i want to insert 2 columns into my destination as col A and col B. based on the values of col A i want to derive the values of col B,like if col A value is 0 then col B value is Good else BAD.

Can any one asssit in this regard how to achive it? and is it possible to use IF and CASE statement in this dervived column tranformation?

Sreenivas

Select the Add New column option, call it ColB or whatever, then use an expression like this -

ColA == 0 ? "GOOD" : "BAD"

This uses the conditional operator, as documented in Books Online - http://msdn2.microsoft.com/en-us/library/d38e6890-7338-4ce0-a837-2dbb41823a37(SQL.90).aspx

Logicaly it reads like this -

If ColA Equals 0 Then

Return "GOOD"

Else

Return "BAD"

End If

Problem with Excel Pivot Table

I am facing problem like;

We generate reports thru Excel Pivot table. The data is coming from sales
cube. Let?s assume that there are 2 products A and B. The user wants to
filter for each product and view ?stock in hand? and ?total sales? for
particular month (as two columns).

From the Pivot table filtering, when we choose product A and month ?Jan?,
it is showing values for ?stock in hand? and ?total sales? columns for that
month.

But when we choose product B and month ?Jan?, it is only showing ?stock in
hand? value and the ?total sales? column was suppressed/unseen. We know
that there is no sales transaction for ?Jan? month. But we still want to
show the column title even if there are no records in the database / cube.

I am not using any scripting, this pivot table was generated just thru
Pivot table wizard.

Any way to achieve this, please advise me.

Advanced thanks for u r help.

--
Message posted via http://www.sqlmonster.comBajal Mohamed via SQLMonster.com (forum@.SQLMonster.com) writes:
> I am facing problem like;
> We generate reports thru Excel Pivot table. The data is coming from sales
> cube. Let?s assume that there are 2 products A and B. The user wants to
> filter for each product and view ?stock in hand? and ?total sales? for
> particular month (as two columns).
> From the Pivot table filtering, when we choose product A and month
> ?Jan?, it is showing values for ?stock in hand? and ?total sales?
> columns for that month.
> But when we choose product B and month ?Jan?, it is only showing ?stock in
> hand? value and the ?total sales? column was suppressed/unseen. We know
> that there is no sales transaction for ?Jan? month. But we still want to
> show the column title even if there are no records in the database / cube.
> I am not using any scripting, this pivot table was generated just thru
> Pivot table wizard.

I'm not really sure why you are asking this in a newsgroup for
SQL Server. It sonds like an Excel issue to me.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Saturday, February 25, 2012

Problem with DB_OWNER role..

Hi All,

I am facing a problem while executing a statement through C++ code
using OLEDB API of Sql server.
There is a problem with DB_OWNER role. If I will enable the DB_OWNER
everything is going fine but if I will remove this role than I am
getting error "DB_E_ERRORSINCOMMAND".

But if I will execute the same in query analyser it is going
absolutely fine in either case.
I am not able to understand why I am getting error while using API.

Please help me.....thanks in advancemonty (manishgandhi13@.gmail.com) writes:

Quote:

Originally Posted by

I am facing a problem while executing a statement through C++ code
using OLEDB API of Sql server.
There is a problem with DB_OWNER role. If I will enable the DB_OWNER
everything is going fine but if I will remove this role than I am
getting error "DB_E_ERRORSINCOMMAND".
>
But if I will execute the same in query analyser it is going
absolutely fine in either case.
I am not able to understand why I am getting error while using API.


I'm afraid that I need to ask for more information. What do you mean
with "enable the DB_OWNER role"? Do you mean that you add the user
you connect with to the DB_OWNER role?

Do you run with the same user from QA?

Have you examined the ISqlServerErrorInfo object to get the error message?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Aug 22, 2:46 am, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

monty (manishgandh...@.gmail.com) writes:

Quote:

Originally Posted by

I am facing a problem while executing a statement through C++ code
using OLEDB API of Sql server.
There is a problem with DB_OWNER role. If I will enable the DB_OWNER
everything is going fine but if I will remove this role than I am
getting error "DB_E_ERRORSINCOMMAND".


>

Quote:

Originally Posted by

But if I will execute the same in query analyser it is going
absolutely fine in either case.
I am not able to understand why I am getting error while using API.


>
I'm afraid that I need to ask for more information. What do you mean
with "enable the DB_OWNER role"? Do you mean that you add the user
you connect with to the DB_OWNER role?
>
Do you run with the same user from QA?
>
Have you examined the ISqlServerErrorInfo object to get the error message?
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
>
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


yes by enabling the DB_OWNER i mean giving DB_OWNER role to the user.
And I am running with the same user in QA with which i am connecting
through API.

Also I have examined ISqlServerErrorInfo object to get the error
message because of that only I am getting error DB_E_ERRORSINCOMMAND.

Feel free to ask for more information....|||monty (manishgandhi13@.gmail.com) writes:

Quote:

Originally Posted by

yes by enabling the DB_OWNER i mean giving DB_OWNER role to the user.
And I am running with the same user in QA with which i am connecting
through API.
>
Also I have examined ISqlServerErrorInfo object to get the error
message because of that only I am getting error DB_E_ERRORSINCOMMAND.
>
Feel free to ask for more information....


I guess then I would need to see your code, including the error-handling
part...

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Aug 22, 3:31 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

monty (manishgandh...@.gmail.com) writes:

Quote:

Originally Posted by

yes by enabling the DB_OWNER i mean giving DB_OWNER role to the user.
And I am running with the same user in QA with which i am connecting
through API.


>

Quote:

Originally Posted by

Also I have examined ISqlServerErrorInfo object to get the error
message because of that only I am getting error DB_E_ERRORSINCOMMAND.


>

Quote:

Originally Posted by

Feel free to ask for more information....


>
I guess then I would need to see your code, including the error-handling
part...
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
>
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


it's ok...but i just want to know...do we need to have DB_OWNER role
for executing DDL statements through OLEDB API ??|||monty (manishgandhi13@.gmail.com) writes:

Quote:

Originally Posted by

it's ok...but i just want to know...do we need to have DB_OWNER role
for executing DDL statements through OLEDB API ??


DDL statements require at least membership in db_ddladmin, no matter how you
connect.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Aug 22, 6:56 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

monty (manishgandh...@.gmail.com) writes:

Quote:

Originally Posted by

it's ok...but i just want to know...do we need to have DB_OWNER role
for executing DDL statements through OLEDB API ??


>
DDL statements require at least membership in db_ddladmin, no matter how you
connect.
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
>
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


I am creating and using a temp table. For doing this db_ddladmin role
will be enough??|||monty (manishgandhi13@.gmail.com) writes:

Quote:

Originally Posted by

I am creating and using a temp table. For doing this db_ddladmin role
will be enough??


I'm sorry, but I would appreciate if you could post your actual code
or in other ways to give me sufficient information what you are doing.
If you insist on just providing pieces, the quality of the answers you
get will be poor.

To create temp tables you need no particular permissions at all.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, February 20, 2012

Problem With Dataset()

Hello all

i m facing a problem "There is already an open DataReader associated with this Command which must be closed first."

what is this alll the another page like thispage is currently working properly

so what is this problem

pleasse help me

ashwani

hi Friend,

do check your code you might be using same datareader without closing it before .

|||

Hi,

There is already an open DataReader associated with this Command which must be closed first.

From the error message you provided, it seems that you are using DataReader in your application, right?

Generally, a datareader represents an open connection to the database. If you want to run 2 readers simultaneously, you need to use two separate connections.

Thanks.