string sql = "select * from test where one='one'"; public static int seleSQL(string sql)
{
SqlConnection con = createCon();
con.Open();
SqlCommand com = new SqlCommand(sql, con);
try
{
return Convert.ToInt32(com.ExecuteScalar());
con.Close();
}
catch (Exception e)
{
con.Close();
return 0;
}
}SQL列数据类型是nvarchar(50)怎么老提示输入字符串的格式不正确
{
SqlConnection con = createCon();
con.Open();
SqlCommand com = new SqlCommand(sql, con);
try
{
return Convert.ToInt32(com.ExecuteScalar());
con.Close();
}
catch (Exception e)
{
con.Close();
return 0;
}
}SQL列数据类型是nvarchar(50)怎么老提示输入字符串的格式不正确
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货