Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 May 28th, 2007, 11:51 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default uploading a file

hello to all
i want to give the functionality in web site that a user can upload excel file which contains the name and phone number.
i want my program read that file and put the records in my database.
although big! but please give me some solution.

regards,
munish


thanks......
__________________
thanks......
 
Old May 29th, 2007, 07:19 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use the Jet driver in the OleDbConnection class to connect to the spreadsheet. That will allow you to read in the information in the spreadsheet into a data table or whatever data structure you want, and from there you can insert the data into your database. I recently tried out the SqlBulkCopy class, which worked really well, and was faster. You could also iterate through your data table and insert one row at a time if thats your preference. Good luck!
 
Old May 29th, 2007, 07:20 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is a link to an article on SqlTeam.com that I found really useful in explaining how to use SqlBulkCopy if you go that route:

http://sqlteam.com/item.asp?ItemID=26941
 
Old May 30th, 2007, 03:11 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks A lot i will try today.

regards,
munish

thanks......
 
Old May 30th, 2007, 04:18 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mate if u found anything useful can you please post it :)

i have a problem which is similar to urs (a bit more complicated :s ) but with the same concept :)

Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading a file with ASP BananaJim Classic ASP Professional 1 December 7th, 2006 06:57 PM
Uploading File misskaos Classic ASP Basics 4 October 26th, 2006 02:56 PM
file uploading lakshmi devi Classic ASP Basics 2 September 3rd, 2006 11:52 PM
FIle Uploading [email protected] Classic ASP Basics 3 February 23rd, 2004 12:32 PM
File uploading zabedin Classic ASP Basics 1 July 16th, 2003 08:33 PM





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