String s1 = "select count(*) from user where id=@i ";
using (SQLCommand command= new SQLCommand(s1, conn)) {
command.Parameters.Add(new SqlParameter[color=red]("id",1));[/color]}
在sql中,new SqlParameter("id",1)第一个参数id是不用@符号的;
而在mysql中,则需要@
using (MySQLCommand cmd2 = new MySQLCommand(s1, conn)) {
cmd2.Parameters.Add(new MySQLParameter[color=red]("@i",1));[/color]}
using (SQLCommand command= new SQLCommand(s1, conn)) {
command.Parameters.Add(new SqlParameter[color=red]("id",1));[/color]}
在sql中,new SqlParameter("id",1)第一个参数id是不用@符号的;
而在mysql中,则需要@
using (MySQLCommand cmd2 = new MySQLCommand(s1, conn)) {
cmd2.Parameters.Add(new MySQLParameter[color=red]("@i",1));[/color]}