hey all please help me about my graduation project
i use this code to insert data on the table
and i have no error,but nothing will save
on the table..so please help me know why !!
thank on advance..
Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True")
Dim cmd As New SqlCommand()
cmd.Connection = con
Try
con.Open()
MsgBox("Connection Open ! ")
cmd.CommandText = "insert into admin (username,pass) values('rami','1234')"
cmd.ExecuteNonQuery()
MsgBox("Record is successfully stored")
con.Close()
Catch ex As Exception
MsgBox("Can not open connection ! ")
End Try
End Sub
End Class