Can someone educate me?

A

Aaron

I have been building a windows app with a sql query, but I was using a
view and I learned that it is very difficult to use a view for updates.

So I began investigating this and found some information regarding
creating multiple sqldataadapters, one for each table, and then
generating a dataset to include all of the tables (sqldataadapters).

The information was found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/vbcon/html/vbwlkwalkthroughcreatingmaster-detailwindowsform.asp

I have then edited the resulting XSD document and added realtionships and
keys, in an attempt to replicate the relationships that exist in my SQL
view.

So I have a few questions about how to proceed selecting and updating the
data.

Now that I have multiple dataadapters, and each one has it's own
select/insert/update/delete commands, and I had previously selected from
a view which contained all of the necessary columns, how do I select
these multiple columns from multiple tables and maintain the
relationships?

Which DataAdapter do I use for the select?

When I do the .fill, which dataadapter should I use?

How do I get the selected columns to appear in my datagrid?

Why does my datagrid have a plus sign in the row header and all of the
key relationships as links?

Is there any material that covers these questions? I have been unable to
find many relavent articles.

If there is a way of updating a view, please let me know how, I may be
able to salvage the original application.

Thanks for your time.

Aaron
 
S

Sébastien

Question 1:
What do you want to select ? Maybe you want to use some columns in one table
instaed all columns ? Then use a create a DataView or a DataTable.

Question 2 :
You have to do a fill with each DataAdapter
DataAdapter1.Fill (DataSet)
DataAdapter2.Fill (DataSet)
DataAdapter3.Fill (DataSet)
etc...

Question 3:
I don't know enough stuff about DataGrid, but I know that they use relation
names instead column names. So set the DataMember to a relation name you
have in your DataSet

Question 4:
You have a plus sign because DataGrid show relations between tables. You
should find a property to disable this feature.

Question 5:
msdn.microsoft.com

Question 6:
A view is a View, a Table is a Table. You can update a table, but a view, I
guess there is some constraints. You should check at
DataSet.DefaultViewManager or DataSet.Tables("TableName").DefaultView

Good luck in your study. You should get some more help on this group.
Sébastien
 

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