C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Training   ASP.NET Web Hosting    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

Play Silverlight Games or Submit your Silverlight applications and earn 90% AdSense revenue.

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Forums » .NET » .NET »

how to import data from excel 2003 to SQL Server 2005 using C#.Net 2005 Window Application


Posted Date: 16 Dec 2008      Posted By: Pankaj Prajapati      Member Level: Bronze     Points: 1   Responses: 3



hi friends...

i need urgent solution for one problem.

how to import data from excel 2003 to SQL Server 2005 using C#.Net 2005 Window Application

waiting for reply...





Responses

Author: Mahendrakar R Kumar    16 Dec 2008Member Level: GoldRating:     Points: 2

Hi,
You need a mediator for that or a third party tool (DATADOC) , if u want to do problematically odbc driver connection string, sql server connection string is tha hardly u need.

Thanks & Regards,
Mahendrakar R Kumar.



Author: MOHAN BABU DODDAPANENI    16 Dec 2008Member Level: SilverRating:     Points: 6

This is much easy and quick. If you have to do it once then use
Import / Export Wizard that comes with SQL Server 2005

There are a number of different ways to start the SSIS Import / Export wizard. You can start it a couple of ways using the SQL Server Business Intelligence Development Studio. Or you can start it using the SQL Server Management Studio. Lastly, you can start it using an executable.

1) To start the Import/Export wizard in the Business Intelligence Development Studio I need to start up the studio tool and open an Integrated Services project. Once I have done this, there are two methods to start the Import / Export Wizard. The first method is to click on the "Project" menu, and then select the "SSIS Import and Export Wizard..." from the drop down menu,


Another method to start up the SSIS Import/Export Wizard in the Business Intelligence Development Studio is to right click on the SSIS package folder and then select the "SSIS Import and Export Wizard..." This is like a project and u can execute the project as many times as u want.


2) If you want to start the Import/Export wizard from the SQL Server Management Studio then connect to a Database Engine server type. Once you are connected right click on one of your user databases ( where u want the data to be exported, select the "Tasks" item, then either click on the "Import Data..." or "Export Data..." menu item. Below is a screen shot of where to locate the "Import..." or "Export Data..."

3) The last way to bring up the SSIS Import and Export wizard is by running a "DTSWizard.exe" program from the command prompt. If you take the default installation parameters then this executable can be found in the "C:\Program Files\Microsoft SQL Server\90\DTS\Binn directory. Otherwise it will be where ever your installed the Binn directory while installing SQL Server 2005. This is simple and easiet

And the wizard is very simple as u know what to do , i mean what is the source and destination. Just makes sure u explore the options when the wizard is launched.

-->Source is excel
-->destionation is database

And in fact u can even write ur own query before exporting the data.

NJoy!!!
.Mohan Babu



Author: MOHAN BABU DODDAPANENI    18 Dec 2008Member Level: SilverRating:     Points: 4

If it in C#, u need to use the DTS ( Data Transformation Service ) tasks
i.e Data Flow Task

If u had done as i explained above the same can be donw programatically

1) Create a DTS package ,
2) Add a DTS Flow Task
3) Add Source and Destionation to the Task
4) U may need to create the connections

thses steps are broad

U may find the sample of using it

http://msdn.microsoft.com/en-us/library/ms161541(SQL.90).aspx

If u had installed the sample along with SQl server then u may find it here

C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\\Programming Samples\Control Flow\CreatePackage sample


.Mohan Bau



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : ACTIVE DIRECTORY USER
Previous : Third Party Controls
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use