473,480 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dAdapter.FillSchema vs dAdapter.Fill with dataset.clear?

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
Sep 12 '06 #1
1 5203
Any suggestions appreciated which method is the best practice
- or if neither method above is best practice - what would be a best practice
method?
Can you elaborate on what exactly you need to accomplish?
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 insert
rows into?

Thanks,

Seth Rowe

Rich wrote:
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
Sep 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3257
by: Programmer | last post by:
Hi All Here is my problem I'm using a SQLDataAdapter and DataSet I use the method FillSchema(myDataset, SchemaType.Source) The problem is that when i Check the default Values of the Dataset...
2
6055
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for...
2
1304
by: Aaron Ackerman | last post by:
I have been having just on going problems with my MS Datagrids. I have NO idea what I am doing wrong. What is esentially happening is that say I have three records in my Dataset. I click on the...
1
1664
by: scottin | last post by:
I setup the dataset, which is the datasource for a datagrid. When I originally fill the dataset, the data is loaded into dataset.tables(0). (dataset.tables(0).rows.count = 8) Then, if a row...
3
4597
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for...
3
1536
by: Marc Llenas | last post by:
Hello all, I'm new to ASP.NET and I have a question regarding the fill method of a dataset. Here is my code 1 Dim objConn As OleDbConnection 2 Dim objAdapt As OleDbDataAdapter 3 Dim...
2
5208
by: MDB | last post by:
Hello All, I have a data grid that I fill using a dataset. The results of the query has around 15 columns and 500 rows (and growing). The reason I am using the datagrid is so the end users can...
0
1414
by: ReneMarxis | last post by:
Hello all first let me say i start getting an idea on how powerful data binding is. You can hold your code as short as possible and also have a pretty big flexibility. Also thanks to this...
8
5145
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all I noticed that if Select stmt returns dataset containing two tables, executing FillShema only populates schema info for first table only. Simple test: (.NET 2.0) .... string strSQL...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7061
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4503
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
574
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.