Hi My Friends Can any one help my in my Question ?? I Have (DataSet) content data coming from database like Oracle , MySQL , Access or SQL Server … How Can I Save the data from (DataSet) into another Database The Following Code Fill the DataSet with data Coming
from SQL Server database SqlConnection Connection = new SqlConnection (strConnection); SqlDataAdapter DA = new SqlDataAdapter ("SELECT * FROM tbl1",Connection); Connection.Open(); DA.SelectCommand.ExecuteNonQuery(); DataSet dataSet = new DataSet(); DA.Fill(dataSet,”tbl_Test”)
How Can I fetch data From the above dataset into another SQL Server Database or another Database System ? And thanks
C# ( pronounced as C-sharp ) is a new Java like language from Microsoft. Microsoft says that C# is a language with the power of C++ and simplicity of Visual Basic. C# supposed to be the best language for Microsoft's .NET programming
Hi I try and try but I cant do that .... can you give me pice of code please and thanks
C# ( pronounced as C-sharp ) is a new Java like language from Microsoft. Microsoft says that C# is a language with the power of C++ and simplicity of Visual Basic. C# supposed to be the best language for Microsoft's .NET programming
If you're using Visual Studio go into Design Mode for the page and then open up the Server Explorer. Navigate down to the target table (the one you're going to insert the records into) and drag the table name onto the page. Visual Studio.Net will create the
appropriate DataAdapter and the commands for insert and update. You may need to modify them to suit your specific needs. If so, what I do is copy and paste the VS generated code to someplace else and use it there. I then delete the version that VS created.
Once you have the DataAdapter set up just call the DataApater's Update method with the arguement being your DataSet/DataTable with the records you want to insert. You'll also need to make sure each record's rowstate is set to "new". They may not be because
you're populating it from another database. If they're not you may have to run a loop through the records and insert them into a new DataSet.
Calling Update on another adapter will NOT work, because of the rowstate problem that McMurdo mentioned; because the RowState of each row is not New, the update call will not insert them. Copying or cloning the rows also copies the RowState, so this doesn't
help. The only method I've found is to manually insert new rows into the new DataTable and copy the values from the old table. AutoFed
FRaas
Member
620 Points
136 Posts
How To fetch data from DataSet to database
Aug 06, 2003 01:42 AM|LINK
JBelthoff
Member
553 Points
135 Posts
Re: How To fetch data from DataSet to database
Aug 06, 2003 02:55 AM|LINK
Dodge, Duck, Dip, Dive & Dodge
If a man can dodge a wrench, he can dodge a ball!
McMurdoStati...
Contributor
3015 Points
601 Posts
Re: How To fetch data from DataSet to database
Aug 06, 2003 03:06 AM|LINK
FRaas
Member
620 Points
136 Posts
Re: How To fetch data from DataSet to database
Aug 06, 2003 06:28 PM|LINK
McMurdoStati...
Contributor
3015 Points
601 Posts
Re: How To fetch data from DataSet to database
Aug 06, 2003 07:40 PM|LINK
autofed
Participant
1789 Points
357 Posts
Re: How To fetch data from DataSet to database
Aug 07, 2003 04:45 AM|LINK