insertcourse_registration() を呼び出すと、次のエラーが発生します
incorrect syntax near ' ?'
コードで insertcourse_registration を呼び出すと、上記のエラーが表示されます。
Public Sub setdata(ByRef lrowcourse_registration As ds_user_master.user_masterRow)
rowuser_master = lrowcourse_registration
End Sub
Public Sub insertcourse_registration()
Try
Try
connectionString = ConfigurationManager.ConnectionStrings("asha_dbConnectionString").ToString
myConnection.ConnectionString = connectionString
myConnection.Open()
MsgBox("Connected to ODBC Database !!")
Catch ex As Exception
End Try
transaction = myConnection.BeginTransaction
command = New SqlCommand("insert into user_master values (?,?,?,?,?)", myConnection)
command.Parameters.Add("@us_user_id", SqlDbType.NVarChar).Value = rowuser_master.us_user_id
command.Parameters.Add("@us_role", SqlDbType.NVarChar).Value = rowuser_master.us_role
command.Parameters.Add("@us_fname", SqlDbType.NVarChar).Value = rowuser_master.us_fname
command.Parameters.Add("@us_lname", SqlDbType.NVarChar).Value = rowuser_master.us_lname
command.Parameters.Add("@us_pass", SqlDbType.NVarChar).Value = rowuser_master.us_pass
command.Connection = myConnection
command.Transaction = transaction
command.ExecuteNonQuery()
transaction.Commit()
Catch ex As SqlException
MsgBox(ex.Message)
End Try
End Sub