i m using following query for inserting data into my database...
everything is ok
but whenever i restart my form there is no data in my tables :(
do i need to use commit statement ??
if yes then how ?
Private Sub Button1_insert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_insert.Click
Try
cn.Open()
Dim query As String = "insert into Department_Master values('" + TextBox1_deptid.Text + "','" + TextBox2_deptname.Text + "','" + TextBox3_remarks.Text + "') "
Dim cmd As New SqlCommand(query, cn)
cmd.ExecuteNonQuery()
MessageBox.Show("Data Inserted")
Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
cn.Close()
End Try
End Sub