c# 数据库

来源:互联网 发布:php study linux 编辑:程序博客网 时间:2024/06/06 19:54
1.获取 SQL 条目的数量
 SqlConnection(            "server=localhost; Initial Catalog=数据库的名字;Integrated Security=SSPI");SqlCommand countCmd = conn.CreateCommand();                countCmd.CommandText="select count(no) as noCount from 表";                conn.Open();                int num = (int)countCmd.ExecuteScalar();                countCmd.Dispose();                conn.Close();
0 0
原创粉丝点击