Results 1 to 7 of 7

Thread: How to access multiple tables in VB.NET?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    5

    How to access multiple tables in VB.NET?

    How to access multiple tables in VB.NET?
    We have 4 tables(in MSAccess) of which one is not related to any other table.
    To access all the 4 tables from a windows form should we have more than one data adapter and data set?

    OR

    Can we have independent data adapters and sets for each table?
    Pls let me know in detail.

  2. #2
    Hyperactive Member
    Join Date
    May 2002
    Location
    Wisconsin, USA
    Posts
    279
    you can use the same DataAdapter to load multiple DataSet's.

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    5

    Thanks

    Thank you very much mr.crpietschmann

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    5
    Closing of Forms.

    My problem is this:

    When a new form(say Form2) pops up on clicking a button on the previous form(say Form1), I need to get the Form1 closed automatically.

    I found the close method but it closes all the forms.Also there is Hide mehtod , but i dont know how to use that. Will this Hide help in solving the problem?

    Pls let me know

  5. #5
    New Member
    Join Date
    Jan 2004
    Posts
    1

    mmm

    To close the form you are in only add Me.Close () to your exit button.

    For example


    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Me.Close()
    End Sub

  6. #6
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    In the event that shows form2:

    Private Sub btnShowForm2(........
    Dim form2 as new form2
    Me.ActiveForm.Hide() 'Hide Form1
    Form2.Showdialog() 'Show Form2
    End Sub

  7. #7
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    "When a new form(say Form2) pops up on clicking a button on the previous form(say Form1), I need to get the Form1 closed automatically.

    I found the close method but it closes all the forms.Also there is Hide mehtod , but i dont know how to use that. Will this Hide help in solving the problem?"

    I think you may find that you have not started your application correctly. If you use the following code in a module and use the sub main as the startup, you will be able to close any form without affecting the others.


    Public frm1 as new Form1
    Public Sub Main()
    Application.Run(frm1)
    end sub

    Regards,
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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