Results 1 to 6 of 6

Thread: New with VB.NET

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Location
    Belgium
    Posts
    25

    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

  2. #2
    Lively Member
    Join Date
    May 2003
    Posts
    78
    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!

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    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
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Location
    Belgium
    Posts
    25
    Thanks for the helpfull replies

    Cheers
    Kris

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Location
    Belgium
    Posts
    25
    nswan your website gives me some errors. I think their is something wrong with your server.

  6. #6
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    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:
    1. 'note, you have to provide a name for the table when you fill it
    2. 'if you dont, vb will provide generic names like Table1, Table2 etc.
    3. daOrders.Fill(ds1, "Orders")
    4. daCustomers.Fill(ds1, "Customers")
    5. daProducts.Fill("ds1, "Products")
    6.  
    7. 'bind to a datagrid
    8. 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
  •  



Click Here to Expand Forum to Full Width