ADO.NET questions

G

Guest

I am novice with C## and ADO.NET. All my prior experience is with VB and old
style ADO.

We have a desktop application that uses MSDE as its database. We need to
have a way to export rows from a few tables from one users computer to
another users computer. This has to happen in a disconnected way so using
DTS is not an option. These are steps hat I was planning to use.

1)use SQLAdapter to create a Dataset with data to be exported on the source
computer.
2)Use DataSet WriteXML method to write out data to xml file.(User then can
email xml file to another user)
3)Create Dataset on Target computer and use ReadXMl method to read data into
dataset.
4)Modify keys on data so as to avoid primary key violatons
5)Create SQLDataAdapter on target computer. Pass in Dataset with data to be
merged while called Update method on SQLAdapter.

I have succesfully done steps 1-3 but I am having problems with 4 and 5.
Has anyone done anything similar to this? Is this the correct way to do
this? Any
pointers to examples of how to this is appreciated.

Thanks in advance.
 
W

William \(Bill\) Vaughn

DTS can export to a flat file that can be reimported elsewhere.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
G

Guest

We are trying to design this app to be compatible with SQL Express 2005.
According to information I have on SQL Express, DTS will not be included in
it so I dont think we can use DTS.

Am I missing something though. My understanding was that using XML files to
move data around was the preferred way in dotNET. Am I taking the wrong
approach in using the dataset writexml method to create a xml file that could
be emailed to another user where he could import back into his version of the
app?
 
W

William \(Bill\) Vaughn

Okay, if you are targeting SQL Express 2005 then you have a much better
alternative--use the BCP functionality built into ADO.NET 2.0. Since SSE
2005 won't be released until VS 2005 you should not have a problem.

Sure, you can use XML to move data to and from SQL Server, but it's very
inefficient. For small amounts of data you can make it work, but it won't
come close to the performance you'll get with BCP/DTS.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top