sqlqrystrng = "UPDATE temp_user_details set user_name = @username, user_email = @useremail, user_contact = @usercontact, user_address=@useraddress WHERE user_id = @userida"
sqlqrystrng2 = "UPDATE user_type set user_password = @userpassword where user_id = @useridb"
string_cnct = sqlqrystrng & sqlqrystrng2
conn.open
cmd = New SqlCommand(string_cnct, conn)
cmd.Parameters.Add(cmd.CreateParameter).ParameterName = "@userida"
cmd.Parameters.Add(cmd.CreateParameter).ParameterName = "@useridb"
cmd.Parameters.Item("@userida").Value = struserid
cmd.Parameters.Item("@useridb").Value = struserid
答案 0 :(得分:1)
sqlqrystrng = "UPDATE temp_user_details set user_name = @username, user_email =
useremail, user_contact = @usercontact, user_address=@useraddress WHERE user_id =
userida"
sqlqrystrng2 = " UPDATE user_type set user_password = @userpassword where user_id = @useridb"
string_cnct = sqlqrystrng & sqlqrystrng2
conn.open
cmd = New SqlCommand(string_cnct, conn)
cmd.Parameters.Add(cmd.CreateParameter).ParameterName = "@userida"
cmd.Parameters.Add(cmd.CreateParameter).ParameterName = "@useridb"
cmd.Parameters.Item("@userida").Value = struserid
cmd.Parameters.Item("@useridb").Value = struserid
您需要在第二个字符串
中的更新之前添加空格