Question Insert query

kavishah

New member
Joined
Feb 4, 2011
Messages
2
Programming Experience
Beginner
Hi,
I am trying to build a simple application using vb.net 2008 and ms access 2003 as a database. I am using table adapters. after i fire a query it doesnot go into the database but it shows in the data grid view. for example i have a database with 3 fields in it, 2 forms are there in one form 3 text box which will accept the values and save button; in another form i ve a datagrid view which shows the value from the database. sample code as follows:
form1 code:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.TableAdapterManager1.Table1TableAdapter.InsertQuery(TextBox1.Text, TextBox2.Text, TextBox3.Text)
Form2.show()
End Sub
End Class

form2 code:
// Page load function
Me.Table1TableAdapter.Fill(Me.ExampleDataSet.Table1)

now after writing of this code application works fine it shows the values in datagridview but it doesnot enter the value in access database.
Please help
 
If you're getting the data from the database and the new data is displayed then the new data must be saved to the database. You are almost certainly looking at the wrong database or the right database at the wrong time. Follow the first link in my signature for information how to manage local data files.
 
thanks buddy, got it. i was just looking in the project folder not in the bin folder now i got it. Thanks again, i was held in this from a week and was not geting solution.
 

Latest posts

Back
Top