您的位置:首页 > 数据库

aso.net 数据库简单操作

2011-07-21 14:51 155 查看
SqlConnection sqlconn = new SqlConnection("Data Source=(local);Database=ss;Uid=sa;Pwd=123");
sqlconn.Open();
SqlCommand sqlcom = sqlconn.CreateCommand();
sqlcom.CommandText = "select count(*) from Region where name='" + TextBox1.Text
+ "' and password='" + TextBox2.Text + "'";
int count = Convert.ToInt32(sqlcom.ExecuteScalar());//获取SQL语句的值 强制转换成数值类型
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: