Dataset to table

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I have a sub method that has been passed a dataset as parameter. I need to
insert this dataset into a table. What is the code that I need to do this?
The dataset does not have any conflicting keys so it is a very easy scenario
from conflict resolution point of view.

Thanks

Regards
 
John,

I assume that you don't confuse alone me.

A dataset is a kind of wrapper around datatables which holds datarows.

In what kind of table do you want to put the dataset?

Cor
 
John,

Than you mean probably the datatable of the dataset.
Is that in an existing table with the same description or do you want to
store a datatable as a complete new datatable.

In other words do you want to use the description of the dataset/datatable
to create new table(s) in your server?

Cor
 
No, the dataset comes from a table which is identical in structure to the
destination table. I only need the current data in the dataset (datatable?)
to be inserted in the destination table.

Thanks

Regards
 
Cor,

I think his scenario is that he gets a dataset with one datatable in it,
with a bunch of rows. He then wants to insert these rows into the database.

I already told him in another thread, that this question has been asked many
many times, and that he should search old postings as well as do research on
the internet on how to do this. But he just wants us to do it all for him?
 
Saying how to insert the dataset is doing it all for me? Hardly. Its easy to
search for broad topics in Google but specifics are hard to find specially
when almost everything in net has million variations.

Regards
 
Are you saying you have found nothing on this topic? This is not all that a
specific thing, it's pretty basic.

Have you tried writing anything to do this? Have you tried actually finding
information?

Have you been reading about how datasets work? Looking at examples that use
dataset to do various operations? Reading documentation?

I suspect that if you had been, you would have had a more specific question
then 'how do move data into a database'. I can't even imagine what sort of
answer you expected - code that is ready to go and working? It's not as if
there is one subtle aspect of this that is causing you problems - you sort
of want the whole thing.

It's not as if you are going to find something that 100% is your situation.
But you will find something close. You will find articles that teach you
about how to use these objects, and you will start to experiment and try
writing code, and learn that way.

I put the following search terms into google: insert rows dataset database

I got the following hits just on the first page of the results that talk
about various techniques for moving data from a dataset into the database,
as well as the ADO.NET object model.

http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/UpdateDataFromDB.aspx
http://msdn.microsoft.com/library/d...conupdatingdatabasewithdataadapterdataset.asp
http://www.akadia.com/services/dotnet_update_form.html

I think with a little bit of effort you could have found this, and much more
as well.
 
Sheer amount of information retrieved and the need to look for the specific
point in the code haystack proves my point but hey I am not complaining...
 
Back
Top