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??
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
Re: Creating TableAdapters with the TableAdapter Configuration Wizard
What are you trying to accomplish? Be specific.
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:
Dim data As New SomeDataSet
Dim adapter As New SomeTableAdapter
adapter.Fill(data)
Alternatively, you can call GetData to return a standalone DataTable without a DataSet:
vb.net Code:
Dim adapter As New SomeTableAdapter
Dim table = adapter.GetData()
Re: Creating TableAdapters with the TableAdapter Configuration Wizard
Quote:
Originally Posted by
malatesh kumar
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.
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