Results 1 to 6 of 6

Thread: Creating TableAdapters with the TableAdapter Configuration Wizard

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Posts
    229

    Creating TableAdapters with the TableAdapter Configuration Wizard

    Hi I am working VB.NET08, Access DB.
    I was Created TableAdapter through Configuration Wizard , and i applied joins and Filters on the wizard. Finally i am getting the rows which i want, and now one table was created in my dataset.
    Now i want to use this table in my code.
    So how can i access this table??
    Plz give me suggessions.
    And one think:

    If i update few records in my database, is there update also in this table?? why b`se this table is not in the Database right??

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Posts
    229

    Re: Creating TableAdapters with the TableAdapter Configuration Wizard

    I know there are two properties like Fill and Getdata .
    By using these properties can i access the table??
    If Possible then plz send the sample code for using this Properties.
    Thanks

  3. #3
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Creating TableAdapters with the TableAdapter Configuration Wizard

    What are you trying to accomplish? Be specific.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Creating TableAdapters with the TableAdapter Configuration Wizard

    Just because data is in your database doesn't mean that it's in your DataSet. Just any DataTables in your DataSet, if you want data in them then you have to get it using the corresponding TableAdapter. You need to create an instance of your DataSet and an instance of your TableAdapter and then use the TableAdapter to populate the DataTable in the DataSet. You can add the DataSet and the TableAdapter to the form in the designer or you can create them in code.
    vb.net Code:
    1. Dim data As New SomeDataSet
    2. Dim adapter As New SomeTableAdapter
    3.  
    4. adapter.Fill(data)
    Alternatively, you can call GetData to return a standalone DataTable without a DataSet:
    vb.net Code:
    1. Dim adapter As New SomeTableAdapter
    2. Dim table = adapter.GetData()
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Creating TableAdapters with the TableAdapter Configuration Wizard

    Quote Originally Posted by malatesh kumar View Post
    I know there are two properties like Fill and Getdata .
    By using these properties can i access the table??
    If Possible then plz send the sample code for using this Properties.
    Thanks
    They are methods, not properties.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Posts
    229

    Re: Creating TableAdapters with the TableAdapter Configuration Wizard

    Hi Jm..
    I am getting Oledb Exception error in the Fill Method line.

    "The Microsoft Office Access database engine cannot find the input table or query 'jointable'. Make sure it exists and that its name is spelled correctly."

    My Code is:

    Code:
    Dim ds As DataSet = New dbContactsDataSet
            Dim query As String = ("Select * from jointable")
            Dim da1 As New OleDbDataAdapter(query, cn)
            Dim dt1 As DataTable = DbContactsDataSet.Tables.Add("jointable")
            Debug.Print(dt1.Rows.Count)
            da1.Fill(dt1)
    My Dataset is "DbContactsDataSet" after i created the Table Adapter The new Table name is "jointable"
    Where i did mistaked.....
    Thanks

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