|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
dAdapter.FillSchema vs dAdapter.Fill with dataset.clear?I want to use a dataAdapter to insert rows into a table on a sql server DB. I understand that the DataAdapter will automatically handle concurrency issues. So first I have to get a table to insert a row into. I have been doing this: da.SelectCommand = New SqlCommand("Select * from tbl1", conn) da.FillSchema(ds, SchemaType.Source, "tbl1") .... my other method was this: da.SelectCommand = New SqlCommand("Select * from tbl1", conn) da.Fill(ds, "tbl1") ds.Clear I read one post of someone who said that the Fillschema method used more resource than the Fill method. But I am thinking, what if I already have a ton of rows in the table? I only need the schema of the table to insert a new row into. Any suggestions appreciated which method is the best practice - or if neither method above is best practice - what would be a best practice method? Thanks, Rich > Any suggestions appreciated which method is the best practice Can you elaborate on what exactly you need to accomplish?> - or if neither method above is best practice - what would be a best practice > method? > I want to use a dataAdapter to insert rows into a table on a sql server DB. Also is tbl1 in the same SQL server db that you are wanting to insertrows into? Thanks, Seth Rowe Rich wrote: Show quoteHide quote > Hello, > > I want to use a dataAdapter to insert rows into a table on a sql server DB. > I understand that the DataAdapter will automatically handle concurrency > issues. So first I have to get a table to insert a row into. I have been > doing this: > > da.SelectCommand = New SqlCommand("Select * from tbl1", conn) > da.FillSchema(ds, SchemaType.Source, "tbl1") > ... > my other method was this: > > da.SelectCommand = New SqlCommand("Select * from tbl1", conn) > da.Fill(ds, "tbl1") > ds.Clear > > I read one post of someone who said that the Fillschema method used more > resource than the Fill method. But I am thinking, what if I already have a > ton of rows in the table? I only need the schema of the table to insert a > new row into. Any suggestions appreciated which method is the best practice > - or if neither method above is best practice - what would be a best practice > method? > > Thanks, > Rich |
|||||||||||||||||||||||