IT Community - Software Programming, Web Development and Technical Support

how to update dataset to sql server?

This is a discussion on how to update dataset to sql server? within the ASP and ASP.NET Programming forums, part of the Web Development category; how to update dataset to sql server? string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\export....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-30-2007, 03:46 AM
smani smani is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 56
smani is on a distinguished road
Question how to update dataset to sql server?

how to update dataset to sql server?

string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\export.xls;Extended Properties=""Excel 8.0;HDR=YES;""";

DataSet ds = new DataSet();
OleDbDataAdapter mydata = new OleDbDataAdapter("Select * FROM [exportZAAH$]", excelConnectionString);
mydata.Fill(ds);

i am having my excelsheet datas in my dataset(ds)

how to update this dataset to my sql server table?

Thanks in advance
Manivannan.s
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-06-2007, 07:29 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: how to update dataset to sql server?

Hi Mani,

Create a select command against your table, and then use a DataAdapter
with a CommandBuilder to automatically flush your DataTable.

EG.

SqlCommand cmd = new SqlCommand("select * from myTable",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
DataTable dt = . . . ;
da.Update(dt);


Use this...
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can we sort the values in dataset? mobilegeek C# Programming 4 04-18-2008 04:39 AM
Removing duplicate rows in a DataSet shaalini ASP and ASP.NET Programming 2 02-13-2008 09:33 PM
Read XML by Dataset gp_logesh ASP and ASP.NET Programming 0 10-31-2007 03:13 AM
Can anybody explain about the differences between dataset.clone and dataset.copy? kingmaker C# Programming 2 08-28-2007 12:22 AM
Difference between ADO.NET dataset and ADO Record set? prasath ASP and ASP.NET Programming 1 07-18-2007 08:06 AM


All times are GMT -7. The time now is 01:52 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0