How do you use an unbound DataAdapter?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've included the needed tables in the DataSource. Those tables that are
bound to controls I can workwith. But how do you get access to the
DataAdaptors that are not bound?

me.Dataset1.table is a table with no Insert or Update methods.
pll.DataSet1.table has the Row, ChangeEvent, and ChangeEventHandler.

It seems like it should be fairly straight forward to use the DataAdapter
without binding it to a control. How do you do this?

Thanks,
--max
 
Max,

AFAIK is a DataAdapter never bound to controls, can you rephrase your
question.

Cor
 
Hi Cor,

My is how do you use the DataAdaptors from the Data Source if you don't bind
them to a gridview?
 
How do you use them to do what?

Max said:
Hi Cor,

My is how do you use the DataAdaptors from the Data Source if you don't
bind
them to a gridview?
 
Hi Marina,

This may not be the correct way, the best way, or even a good way to do this.

I have a DataGridView that is bound to a query that is the subset of fields
from a join of two tables. New rows are added to this table based on a
selection from a combo box and then I add a row to one of the two tables in
the join and let the DataAdaptor that is bound to the DataGridView refill the
table.

Now if I take the table in question and drag it onto the form with another
gridview and then make the grid view not visible, I can Insert and Update the
table. But that seems weird. Can't I just use the dataadaptors that are
included in the datasource to read, insert, and update the table? Or do I
have to bind them to a control? It would seem that it's probably pretty
straight forward to use the data adaptors without a control, but I haven't
been able to find the documentation yet.

Any ideas??

Thanks,
--max
 
Max,

Are you using a DataGridView on a WindowForms control or a GridView from a
webform. Now it is almost tt impossible to read your message because that
you seems to use your own given words, however those words have a real
meaning too?.

Another sample in that you use the word datasource. A datasource is never
connected to a dataAdapter. Or you should mean a DataAdapter that is used to
get a resultset from a data source, where the last is than the DataBase
Table or are joined tables from that .

Can you use the right names than it will probably be a lot easier to
understand.

Cor
 
Hi Cor,

Not to argumentative, but I think I am using the correct words, as I am
looking both at this the reply and the IDE at the same time.

I am trying to develope a Window Form Application. I guess I should have
put that in the first message. Sorry.

On the left side of the IDE is a Window, with Data Sources (a treeview).
This window has three tabs at the bottom labeled "Data Sources", "Server
Explorer", and "Toolbox". The first entry in "Data Sources" is "DataSet1",
under that are the tables that were included in the "Configure DataSet with
Wizard ...", some are just tables, and others are tables based on views or
queries. Clicking on the plus next to each table reveals the available
fields.

Now if you drag a table to the Windows Form you get a DataGridView control
bound to table. In the are below the form, I forget what you call that area,
but above the window that have the "Output" information, where the MenuStrip
ends up, are more control intro information where you can now see "DataSet1",
"TablenameBindingSource", and "TablenameTableAdapter". These items are put
there by the IDE when you drag the table to the form. Now you can use the
"TablenameTableAdapter" in you code to Update the table, Insert new rows, etc.

Now there are other tables in the "Data Sources" on the left that haven't
been used or bound to a control on the Windows Form. My question is how do
you get access to the tables that are in the list without binding the table
to a control? Is that possible? If I take the table I want to update and
drag it to the form to get a DataGridView and then make that DataGridView
invisible I can update and insert rows in the table. How would you get
access to the table without adding the table to the form and making it
invisible?

I am sorry if you cannot understand my question. The question seems pretty
obivious to me.

Thanks,
--max
 
Max,

Now at least I can understand what you tell. However I deny that you told
what you want, to get it better for the next time, I first show you were you
have confused us.

You told that you have used DataAdapter (in the way as you use it a kind of
base control for the tableadapter, where you have used the TableAdapter and
than we had better knowed what you did mean).
You have used the word GridView often (a webform control) where you where
talking about the DataGridView.

The most confusing was however that you were consequently speaking from an
unbound dataadapter even when I told that that is impossible to bind a
dataadapter. You were staying to tell about that not binding of the
dataadapter. This confuses and makes in my idea good answers almost
impossible.

However, there are thousand ways to go further from the point you are now.
Be aware that most active in these newsgroups do not use the Strongly Typed
Dataset. One of the problems with it is that you cannot give good samples.

I have made a new sample based on the Designer version 2005 Strongly Typed
Dataset.

I have used as underlayer the code that is created by the Designer if you
drag a Designer DataSource Table in to the form and create with that
automaticly a DataGridView and toolstrip etc.

The last I did not do. The code that is generated by dragging that table on
your form, can be seen by clicking in top of solution explorer "show all
files" and than in the form open the part form1.designer.vb.

Here is the sample.

http://www.vb-tips.com/default.aspx?ID=601f22fe-a58d-4161-b0c6-5b7490dcc574

I hope this helps,

Cor
 
Back
Top