dinesh_bali
asked on
Importing data from Excel in Database SQL2005
Hi,
I am working in C# and making Windows Application.
I have an excel file to which I want to import in the database SQL 2005
How can i do this, also I do not want to make dsn, but i can make file DSN
Can anyone help me in this regard
Thanks in Advance
I am working in C# and making Windows Application.
I have an excel file to which I want to import in the database SQL 2005
How can i do this, also I do not want to make dsn, but i can make file DSN
Can anyone help me in this regard
Thanks in Advance
ASKER
Ok, If you have the solution with DSN or some other,
that if user click on the button then the filtered data goes into sql 2005
Thanks in Advance
that if user click on the button then the filtered data goes into sql 2005
Thanks in Advance
Is this a web application, or a windows application?
You can import excel file into SqlServer using SqlServer Enterprize Manager try following:
Select Tools tab.
In that select Data Transformation Services.
In that select import Data
Then you follow the wizard.
Hope this helps.
Another approach I used some time ago : I read data from Excel to DataSet, just need appropriate connection string
Then changed connection and saved into database. Can't remember details exactly but it worked well and was quite easy.
Select Tools tab.
In that select Data Transformation Services.
In that select import Data
Then you follow the wizard.
Hope this helps.
Another approach I used some time ago : I read data from Excel to DataSet, just need appropriate connection string
Then changed connection and saved into database. Can't remember details exactly but it worked well and was quite easy.
ASKER
I want to do using C# code.
My excel format and database format is not same.
So I need to filter the data from C# SQL Query and then insert the data in the database.
Can you please help me in this context
My excel format and database format is not same.
So I need to filter the data from C# SQL Query and then insert the data in the database.
Can you please help me in this context
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It is certainly possible, but there's all sorts of inherent problems with this. For one, Excel is a user application, so it might flash up "dialog boxes" in the "user space" of the account running your code. If your code is a web application, this can freeze your web application. Secondly, Jet is pretty bad at recognising data types. If the first 5 rows of data in one column look like numbers, but there is a text string somewhere in that column, it will cause errors.
So it really comes back to what the end-use of this is; server (web or other) application, or a user application? Is the SQL server a local install, or a centrally managed server?
A
So it really comes back to what the end-use of this is; server (web or other) application, or a user application? Is the SQL server a local install, or a centrally managed server?
A
A.