日期:2008-10-04 浏览次数:20563 次
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace winApplication
{
public class sqlAccess
{
//与SQL Server的连接字符串设置
private string _connString;
private string _strSql;
private SqlCommandBuilder sqlCmdBuilder;
private DataSet ds = new DataSet();
private SqlDataAdapter da;
public sqlAccess(string connString,string strSql)
{
this._connString=connString;
}
private SqlConnection GetConn()
{
try
{
SqlConnection Connection = new SqlConnection(this._connString);
Connection.Open();
return Connection;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"数据库连接失败");
throw;
}
}