I had a project running perfectly i.e. entering values in database linked by code. But in the other project I am implementing it shows values correctly submitted, gives no error while running but values are not entered in database.
Private Sub frmAddresume_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cn.ConnectionString = "Data Source=ROHAN-PC\SQLEXPRESS;initial catalog=Libeasy;Integrated Security=true" DateTimePicker1.Value = DateTime.Now.ToShortDateString() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If (TextBox1.Text <> "" And TextBox2.Text <> "" And TextBox3.Text <> "") Then cn.Open() cmd.Connection = cn cmd.CommandText = "insert into StudResume values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + DateTimePicker1.Value.ToShortDateString() + "'," + TextBox3.Text + ")" cmd.Dispose() cn.Close() MsgBox("Details saved Successfully", MsgBoxStyle.Information, "Done") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" DateTimePicker1.Value = Now TextBox1.Focus() Else MsgBox("Please Enter Complete Details", MsgBoxStyle.Critical, "Error") End If End Sub