|
-
Jun 7th, 2003, 10:15 AM
#1
Thread Starter
Junior Member
New with VB.NET
Hello,
I'm new with VB .NET i always worked with Visual Basic 6 but i have a question. I'm working on a Facturation Program and i have 6 forms with each controls linked to a table. Like Customers, Products, Orders, ...
What is the best way to connect? Different Datasets or one Dataset with all tables in it? I'm also new with datasets so i don't know alot of it.
Can someone helps me?
Best Regards
Kris
-
Jun 7th, 2003, 10:58 AM
#2
Lively Member
Hi Kris,
I'm pretty new to all this too but have been using datasets alot over the last few weeks. I tried to connect all my database tables through one dataset, dataadapter and all that and found I was having problems with updating and deleting fields/rows from my database (partly because the wizard that sets it all up when you add a dataapater would not createupdate and delete commands and being new to VB/SQL/Databases found it difficult to make my own that worked. The good thing about having everything in one is that its not so messy and easier to work with in terms of remembering which records are going where.
However as I am a idiot and couldn't get everything working as one I went for separate datasets with one connection and separate adapters. This is probably not the most logical way and may visually look a mess but it works for me and it means I can easily work with individual tables without annoying complications. I have had no problems so far doing it this way and the application that I am building is quite a way in. It's easy to use (as long as you remember which table is connected to what) as I can load each table when I need it anddon't have to worry about any of the other tables.
So there you go, my (partly forced) choice is everything separate, with no problems yet!
-
Jun 7th, 2003, 11:01 AM
#3
Fanatic Member
Hi,
take a look at my website as i have an example application i am building for holding customer/product/order information etc..
www.vb-tech.com
-
Jun 7th, 2003, 11:07 AM
#4
Thread Starter
Junior Member
Thanks for the helpfull replies
Cheers
Kris
-
Jun 8th, 2003, 02:59 AM
#5
Thread Starter
Junior Member
nswan your website gives me some errors. I think their is something wrong with your server.
-
Jun 8th, 2003, 07:00 AM
#6
Frenzied Member
Originally posted by CJN
Hi Kris,
I'm pretty new to all this too but have been using datasets alot over the last few weeks. I tried to connect all my database tables through one dataset, dataadapter and all that and found I was having problems with updating and deleting fields/rows from my database (partly because the wizard that sets it all up when you add a dataapater would not createupdate and delete commands and being new to VB/SQL/Databases found it difficult to make my own that worked. The good thing about having everything in one is that its not so messy and easier to work with in terms of remembering which records are going where.
However as I am a idiot and couldn't get everything working as one I went for separate datasets with one connection and separate adapters. This is probably not the most logical way and may visually look a mess but it works for me and it means I can easily work with individual tables without annoying complications. I have had no problems so far doing it this way and the application that I am building is quite a way in. It's easy to use (as long as you remember which table is connected to what) as I can load each table when I need it anddon't have to worry about any of the other tables.
So there you go, my (partly forced) choice is everything separate, with no problems yet!
You dont have to use separate DataSets. You only need one DataSet and one DataAdapter for each table. So if you have 3 tables, you would need 3 DataAdapters.
example:
VB Code:
'note, you have to provide a name for the table when you fill it
'if you dont, vb will provide generic names like Table1, Table2 etc.
daOrders.Fill(ds1, "Orders")
daCustomers.Fill(ds1, "Customers")
daProducts.Fill("ds1, "Products")
'bind to a datagrid
dg.DataSource = ds1.Tables("Orders")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|