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 March 12th, 2004, 10:03 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default Writing a dataset into an access file

Hi everyone,

I am using ADO.NET with Access. I have a dataset filled from a data source which has one-to-one correspondance with an Access table. I would like to know what is the most efficient way to fill the Access table with this dataset. Should I iterate through the dataset and call SQL inserts?? I am hoping there is a better way.

Thank you for any help you might give me.

Sincerely,

Pankaj

 
Old March 14th, 2004, 12:50 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

Dear friend:
Each database has its our specification! advantages & disadvantages!
So if u r using Access & DataSet, there is a DataAdapter [u]DATA Object</u> too to fill ur Dataset using its fill method
Code:
DataAdapter.[u]fill</u>(mydataset)
.
Keep in touch.

Always:),
Hovik Melkomian.
 
Old March 14th, 2004, 08:44 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I do not need to fill the dataset. The dataset is already filled. I need to put the dataset into an Access table.

Best,
Pankaj

 
Old March 15th, 2004, 02:18 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

if u mean update use
Code:
DataAdapter.[u]Update</u>(mydataset)
.

Sorry if i couldnt help, u were not clear, HTH.

Always:),
Hovik Melkomian.
 
Old March 15th, 2004, 04:25 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No problems man. It is you who is doing me favor by replying, not the other way around :D

My problem is that the dataset is filled from an SQL server sourceand I need to put this dataset in an access file. The dataset is not connected to the access table.

Pankaj

 
Old March 15th, 2004, 11:02 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

Never mind Pankaj, be sure friends r too busy to even check messages:D
Any way I guess I was right in my previous message, didnt it help?!

Always:),
Hovik Melkomian.
 
Old March 15th, 2004, 11:04 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

oh no sorry!!! give me time plz...

Always:),
Hovik Melkomian.
 
Old March 15th, 2004, 11:20 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

Ok my friend:
do u wanna make it a program or just doing it in any way (i mean maybe u wanna export ur data from Access to SQL or vice versa)

do me a favoir by telling ur scenario & request.
I'll do my best.

Always:),
Hovik Melkomian.
 
Old March 16th, 2004, 04:32 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,

Ok, I have to generate an Access report programatically at run time. The data for this report comes from an SQL server source. So, I have a complex query that returns me a dataset. Now I have created an Access database using ADOX with the required table. Now, I want to know the best way to dump this dataset into that table. Of course, I can do multiple UPDATE statements for each row in the dataset. However, I have a feeling there might be a better way to do this.

Thanks :-)

Pankaj

 
Old March 16th, 2004, 05:35 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

OK! In first view I think u need 2 DataAdapters with 2 diffrent Connections!
-First DataAdapter, will fill the dataSet from MS-SQL;
-U'll update & ... ur dataSet;
-Second DataAdapter, will update ur dataset into Access;
(u dont have to update row-by-row! 1 update command is enough, if u use profile for MS-SQL u'll see, its sending all updates command to Database with 1 command.)

HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to Excel from a dataset with VB.Net ruairi VB.NET 2002/2003 Basics 5 July 27th, 2009 12:07 PM
writing into a file in linux file system anboss XSLT 6 June 19th, 2008 01:56 PM
Exporting dataset to an Access File sujith_gokul ADO.NET 0 December 8th, 2005 03:57 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM
Writing a dataset into an access file pankaj_daga Access 0 March 12th, 2004 10:01 AM





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