DataAdapter Questions

B

Bob Day

Using VS 2003, VB.Net, MSDE..

Question 1) Is there anyway to get a collection of the DataAdapters created
in the component designer? I think the answer is no. Something like the
following would be perfect:

Dim DataAdapter as SQLDataAdapter
For each DataAdapter in ComponenetDesigner ' This is line needed
' code to manipulate DataAdapter
Next

Question 2) Is there any way to get the name of a DataAdapter? I think the
answer is no. See following:
Dim DataAdapter as SQLDataAdapter
DataAdapter = ComponentDesigner.DataAdapter
Dim DataAdapter_Name as string = DataAdapter.Name ' This is line
needed

Question 3) Is there any way to see if a Component Designer DataApapter is
using Optimistic or Last In Wins Concurrency? I am figuring this out by
searching the WHERE clause in the UPDATE command text for AND (if it does
NOT have AND, it is Last In Wins). This seems works, but is cumbersome.

Thanks!
Bob Day
 
M

Miha Markic [MVP C#]

Hi Bob,

Bob Day said:
Using VS 2003, VB.Net, MSDE..

Question 1) Is there anyway to get a collection of the DataAdapters created
in the component designer? I think the answer is no. Something like the
following would be perfect:

Dim DataAdapter as SQLDataAdapter
For each DataAdapter in ComponenetDesigner ' This is line needed
' code to manipulate DataAdapter
Next

Unfortunatelly they are not added to any collection.
You might create a collection by yourself though.
Question 2) Is there any way to get the name of a DataAdapter? I think the
answer is no. See following:
Dim DataAdapter as SQLDataAdapter
DataAdapter = ComponentDesigner.DataAdapter
Dim DataAdapter_Name as string = DataAdapter.Name ' This is line
needed

I think that name is used only at design time.
You might use reflection, though, to get it.
Question 3) Is there any way to see if a Component Designer DataApapter is
using Optimistic or Last In Wins Concurrency? I am figuring this out by
searching the WHERE clause in the UPDATE command text for AND (if it does
NOT have AND, it is Last In Wins). This seems works, but is cumbersome.

No, that property is used just for generating sql statements.
You can guess as you stated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top