给你一个例子:
Dim in_m As New SqlCommand
in_m.Connection = sql_conn
in_m.CommandText = "insert into ryb (uname,bmfz,upass,lv,ishead,isadmin,dd,bm0) values(@uname,@bmfz,@upass,@lv,@ishead,@isadmin,@dd,@bm0)"
in_m.Parameters.AddWithValue("@uname", t_u)
in_m.Parameters.AddWithValue("@bmfz", t_b)
in_m.Parameters.AddWithValue("@bm0", t_bm0)
in_m.Parameters.AddWithValue("@upass", "1")
in_m.Parameters.AddWithValue("@lv", 2)
in_m.Parameters.AddWithValue("@ishead", 0)
in_m.Parameters.AddWithValue("@isadmin", 0)
in_m.Parameters.AddWithValue("@dd", t_d)
sql_conn.Open()
in_m.ExecuteNonQuery()
sql_conn.Close()