Data from Dataset into new table in SQL

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

John

Hello: I am having trouble creating a table and then taking the
contents of a dataset and insert it into the new table. I am looking
for methods and exsamples I have read many different approches.

1. I read my data into the dataset from a Text file. I do some
modifactions to the data.

2. I ask the user what table name they want. And then create the
table with the same fields that the text file has and the table name
that they specify.

3. I would like to take the data that is in the dataset and dump it
into the table that was just created. How would I do that?

Again, I have read many differnt ways with no success.

Please help. :)
 
The simplest way, would be to create a dataadapter, with a select clause of
"Select * from MyTable", where MyTable is the name of the table the user
wanted to use. Then, you create a command builder from this data adapter.
You should then be able to just call Update on the data adapter, and update
your data, since all the rows should have a status of 'new' since you
manually added them to the dataset.
 
How do I get the data from the first dataset (The text file) into the new dataset (Sql table)?

----- Marina wrote: -----

The simplest way, would be to create a dataadapter, with a select clause of
"Select * from MyTable", where MyTable is the name of the table the user
wanted to use. Then, you create a command builder from this data adapter.
You should then be able to just call Update on the data adapter, and update
your data, since all the rows should have a status of 'new' since you
manually added them to the dataset.
 
Back
Top