Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 02:39 AM
Authorized User
 
Join Date: Dec 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Loading Excel into SQL Server using ASP.NET

I need to load an Excel file via a web application into SQL Server. I have been able to load the Excel spreadsheet into my application and store it into a DataSet. How do I load the DataSet into SQL Server?

 
Old March 2nd, 2004, 12:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can use the Update statement to sync data to the database. You have to map the data set to the data source (using table and column mappings). Here's an article that shows you how to map your data set to your stored procedures, or there are alternative ways:

http://www.dotnetjohn.com/articles/articleid106.aspx
 
Old March 3rd, 2004, 06:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Im not sure about maping, but sorry to say I dont think it(ur link) was a good sample to use! I mention the open() & close() for Connection. So i didnt saw the rest! there is no need Open/Close Connection for SqlAdapter, thats why I disnt trust the rest codes.
Sorry again.

Always:),
Hovik Melkomian.
 
Old March 3rd, 2004, 12:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

It was meant to show you how to create the mappings, and to do the update. If you needed to do stored procedures, you could do it this way, but there are other ways.

I am curious; how are you using the update statement without opening and closing the connection? Every time I use the update statement without opening and closing the connection, it errored for me. Also, every example I found opened and closed the connection.
 
Old July 21st, 2004, 01:50 PM
Authorized User
 
Join Date: Jul 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
How to load the Excel spreadsheet and store it into a ADO.NET DataSet?
Thanks?
Yubo

 
Old July 21st, 2004, 03:48 PM
Authorized User
 
Join Date: Jul 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you tell me how to uplaod Excel spreadsheet into a DataSet?
Thanks a lot.
Yubo

Quote:
quote:Originally posted by chiefg
 I need to load an Excel file via a web application into SQL Server. I have been able to load the Excel spreadsheet into my application and store it into a DataSet. How do I load the DataSet into SQL Server?

 
Old July 22nd, 2004, 11:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You can open it through ADO.NET using the Jet provider and setting the extended properties to something like "Extended Properties = Microsoft Excel 9.0 Library" or something like that. You can find info on the web about that.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 1.1,VB.NET,crystal reports, SQl server gvi Crystal Reports 1 September 11th, 2008 02:55 AM
excel to sql in asp.net mgpatil17 BOOK: Access 2003 VBA Programmer's Reference 1 June 7th, 2006 01:29 PM
access data of excel sheet into sql server in asp KGANESH2006 SQL Server ASP 2 April 20th, 2006 02:33 AM
Saving Excel data to SQL Server via ASP sankar Classic ASP Databases 6 February 11th, 2005 09:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.