SELECT count(name) from New_Customer;返回值疑问
来源:百度知道 编辑:UC知道 时间:2024/06/22 02:49:41
SELECT count(name) from New_Customer;
C#、access,winForm编程,上面SQL语句的查询结果(name的数量),如何传递给C#程序中的变量(假设为iCount)?
最简单的表述方法。
C#、access,winForm编程,上面SQL语句的查询结果(name的数量),如何传递给C#程序中的变量(假设为iCount)?
最简单的表述方法。
SqlConnection conn = new SqlConnection("Connection String");
string query = "SELECT count(name) from New_Customer;";
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = query;
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
int iCount = int.Parse(reader[0].ToString());
}
关于select count()
select count(*) 的问题
select count(*) from的问题
"select count(*) Mycount from books "
SELECT Count(*) AS aa FROM是什么意思?
oracle性能问题 select count(*) from view
select count(*) as sc_name from school是什么意思?
select count(*) into :i from userinfo &
select count(*) from 表名 是什么意思?
SELECT @CNT=COUNT(*) FROM TABLE1 WHERE [NAME]= @ADDRNAME