// select query 의 단일 값
int iCount = 0;
using (SqlConnection con = new SqlConnection("ConnectionString"))
{
//command
SqlCommand cmd = new SqlCommand("select count(0) from dbo.test", con);
cmd.CommandType = CommandType.Text;
con.Open();
// 쿼리의 단일값
iCount = Convert.ToInt32(cmd.ExecuteScalar());
}
Response.Write(iCount.ToString());