public int countmessage(string name)
{
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["SQLCONNECTIONSTRING"]);
SqlCommand myCommand = new SqlCommand("select count * as count from answer where name='"+name+"'", myConnection);
myConnection.Open();
int zyID=(int)myCommand.ExecuteScalar ();
myConnection.Close();
return zyID;
}
{
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["SQLCONNECTIONSTRING"]);
SqlCommand myCommand = new SqlCommand("select count * as count from answer where name='"+name+"'", myConnection);
myConnection.Open();
int zyID=(int)myCommand.ExecuteScalar ();
myConnection.Close();
return zyID;
}
啊啊啊啊啊啊啊啊啊啊!!!1
int xx=System.Convert.ToInt32(myCommand.ExecuteScalar ())