questions about connection

Pramit Kumar Pal

New member
Joined
Mar 22, 2012
Messages
1
Location
Calcutta, India, India
Programming Experience
3-5
I have a created a database in mysql
db name-student
tables that are inside it are
stdata--which holds roll number and name of 4 students

i use phpmyadmin to connect to my database using "root" as username and "pramit" as password
i have created the data connection using server explorer
it is SUCCESSFUL and I CAN view my data in DATAGRIDVIEW
but now i want to input data into the two fields roll and name
and want to update the original database when i click a button
How do i do that?
Plz help
I have done the program as given below and what should i modify in the sub procedure (Button1_Click) to get the desired result

Public Class datagridview

Private Sub datagridview_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'StudentDataSet.stdata' table. You can move, or remove it, as needed.
Me.StdataTableAdapter.Fill(Me.StudentDataSet.stdata)

End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
 
You are calling Fill on a TableAdapter to populate a DataTable. You call Update on the same TableAdapter to save changes from the same DataTable. I suggest that you follow the Data Walkthroughs link in my signature and do some reading. Those walkthroughs will be for SQL Server or Acces but it's almost exactly the same regardless.

By the way, don't tell people your passwords, even if you think that they can't use them.
 
Back
Top