- 博客(0)
- 资源 (3)
- 收藏
- 关注
asp.net 系统
ublic SqlConnection lianjie()//数据库链接
{
common sd = new common();
SqlConnection conn = new SqlConnection(common.str);
conn.Open();
return conn;
}
public bool zhixing(string sqlstr)//执行sql语句的公共方法
{
common sd = new common();
SqlConnection con = new SqlConnection(common.str);
con.Open();//打开数据库链接
SqlCommand com = new SqlCommand(sqlstr, con);//创建实例
try
{
com.ExecuteNonQuery();//执行sql命令
return true;
}
catch
{
return false;
}
finally
{
con.Close();//关闭数据库
}
2010-11-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人