如何获取sql select语句的返回值?
SqlConnectionconn1=newSqlConnection(connsql);conn1.Open();SqlCommandcmd3=newSqlComman...
SqlConnection conn1 = new SqlConnection(connsql);
conn1.Open();
SqlCommand cmd3 = new SqlCommand();
cmd3.CommandText = "select score from [user_rate] where [userid] = '" + n + "' and [courseid] ='" + m + "'";
cmd3.Connection = conn1;
cmd3想在user_rate表中选出唯一一条score记录,怎么把这个数值赋给一个int a ??
vs2008 c# 展开
conn1.Open();
SqlCommand cmd3 = new SqlCommand();
cmd3.CommandText = "select score from [user_rate] where [userid] = '" + n + "' and [courseid] ='" + m + "'";
cmd3.Connection = conn1;
cmd3想在user_rate表中选出唯一一条score记录,怎么把这个数值赋给一个int a ??
vs2008 c# 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询