hello,
I am using the code below to add to the database but for some reason i get an error message "provider". i donot know what am doing wrong. It is a whole table although at the moment am trying out with one field. i dont know if i should still have an sqldatasource on my web page as i am inserting into the database and not reading from it. please advise.......
Dim conn As String = System.Configuration.ConfigurationManager.Connecti onStrings("ConnectionString7").ConnectionString
Dim myConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(conn)
Dim MySQL As String = "INSERT INTO researcher (R_Surname) VALUES ('" + (TextBox9.Text) + " ')"
Dim cmd As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(MySQL, myConnection)
cmd.CommandType = System.Data.CommandType.Text
cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("R_Surname", TextBox9.Text))
myConnection.Open()
cmd.ExecuteNonQuery()
myConnection.Close()