Hi all,
I am new to asp.net programming and i have to design a website which should accept values from the user and store it in the databse on a button click event.
I am not able to do it In fact i have written a code for button click the code is as follows:
Dim conn As New SqlConnection
conn.ConnectionString = "data source=.\\SQLEXPRESS;initial catalog=HRDATA;integrated security=true"
Dim cmd As New SqlCommand
cmd.CommandText = "INSERT INTO Employee Data values ('" & txt_name.Text & "')"
cmd.Connection = conn
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
the problem that i am facing is at
cmd.ExecuteNonQuery()
the error message i am getting is tht the ExecuteNonQuery is not initialized..
Thanks in advance ...
Karthik.