日期:2014-05-18 浏览次数:20489 次
using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; /// <summary> /// 数据库操作类 /// </summary> public class cs_data { private string connstring; private SqlConnection sqlconn; private SqlCommand sqlcomm; private SqlDataAdapter sqlda; private DataSet ds; private SqlDataReader sqldr; public cs_data() { connstring=System.Configuration.ConfigurationManager.AppSettings["crmConn"]; sqlconn = new SqlConnection(connstring); sqlcomm = new SqlCommand(); sqlda = new SqlDataAdapter(); ds = new DataSet(); } /// <summary> /// 填充DataSet /// </summary> /// <param name="QueryString">sql语句</param> /// <returns></returns> public DataSet Tdataset(string QueryString) { sqlda.SelectCommand = new SqlCommand(QueryString, sqlconn); sqlda.Fill(ds, "temp"); return ds; } }