Total Answers and Comments: 22
Last Update: October 29, 2009
Submitted by : BalaSM hi
it is possible
DataSet ds;
sqlAdap.Fill(ds);
Datatable dt = ds.Tables[0].copy();
//now the structure and data are copied into 'dt'
ds.Tables.remove(ds.Table[0]);
//now the source is removed from the 'ds'
Above answer was rated as good by the following members: surendra_sahu786 , kapilsanchihar
Sorting Options
Latest First
Oldest First
By Rating
May 11, 2006 07:34:43 #5
Sathyavathi
RE: How to copy the contents from one table to another... Hi
You can do it in ado.net 2.0 using SqlBulkCopy.
Regards
Sathyavathi
Is this answer useful? Yes | No
June 12, 2006 04:03:02 #6
Vivek
RE: How to copy the contents from one table to another... Hi
You have to use dataset as datasource. and when you retrieve data in dataset use clone() method to make copy of one table to another.
Vivek B.
Is this answer useful? Yes | No
June 22, 2006 09:29:29 #7
rahul kulshrestha
Ans: How to copy the contents from one table to another... Hi
I use reader to hold the data. and this reader is passed to sqlbulkcopy to write on the destination server.
if u want further information then mai me on my id.
strSql SELECT * FROM authers
CommandSourceData
New SqlCommand(StrSql SourceConn)reader CommandSourceData.ExecuteReader()
Using bcp _
New SqlClient.SqlBulkCopy(DesConnString)bcp.DestinationTableName _
authers
' Write from the source to the destination. bcp.WriteToServer(reader)
End Using reader.Close()
Is this answer useful? Yes | No
August 02, 2006 06:03:06 #9
BalaSM
RE: How to copy the contents from one table to another... hi
it is possible
DataSet ds;
sqlAdap.Fill(ds);
Datatable dt ds.Tables[0].copy();
//now the structure and data are copied into 'dt'
ds.Tables.remove(ds.Table[0]);
//now the source is removed from the 'ds'
Is this answer useful? Yes | No 2 0 Overall Rating: +2
Go To Top