 |
| 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
|
|
|
|

March 12th, 2004, 10:03 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 14th, 2004, 12:50 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
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.
|
|

March 14th, 2004, 08:44 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 15th, 2004, 02:18 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
if u mean update use
Code:
DataAdapter.[u]Update</u>(mydataset)
.
Sorry if i couldnt help, u were not clear, HTH.
Always:),
Hovik Melkomian.
|
|

March 15th, 2004, 04:25 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 15th, 2004, 11:02 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
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.
|
|

March 15th, 2004, 11:04 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
oh no sorry!!! give me time plz...
Always:),
Hovik Melkomian.
|
|

March 15th, 2004, 11:20 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
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.
|
|

March 16th, 2004, 04:32 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 16th, 2004, 05:35 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
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.
|
|
 |