vendredi 18 avril 2014

How can I write Update, Search, Delete code?


Vote count:

0




i am having trouble again ... i am creating a small vb.net 2010 windows application that saves first name, second name etc .. connected to mysql server database i wrote the save code and i am stuck in update, search, delete i am running out of time i should finish this after 4 hours helllllp here is my save code ... can anyone provide me with a matching delete, update, search code? Dim conStr As String = ("Data Source=localhost;user id=root;password=123456;database=sam;") Try Dim con As New MySqlConnection(conStr) Dim cmd As MySqlCommand con.Open()



Dim sqls As String = "INSERT INTO initial_nom(f_name,s_name,th_name,fo_name,app_no,adm_type) VALUES('" & TextBox1.Text & "', '" & TextBox2.Text & "', '" & TextBox3.Text & "', '" & TextBox4.Text & "'," & TextBox5.Text & ",'" & ComboBox4.SelectedItem.ToString & "')"
cmd = New MySqlCommand(sqls, con)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox("Error in saving to Database")
dbconn.Close()
End Try


asked 15 secs ago

Sam

8





Aucun commentaire:

Enregistrer un commentaire