using System; using System.Data; using System.Data.OleDb; using System.Configuration; using System.Data.Sql; using System.Data.SqlClient; using System.Web; using System.Web.Security; using System.Security.Cryptography; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.IO; using System.Text; using System.Globalization; using System.Threading; // using System.Collections; namespace LYS { /// ///UserData1 的摘要说明 /// public class UserData1 { MyFiles myf = new MyFiles(); //private string connectionString = "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\MYDBSQL.mdf;User Instance=true"; private string connectionString = "Data Source=192.168.0.66;Initial Catalog=Ddxt;Persist Security Info=True;User ID=sa;Password=1;Pooling=True;Max Pool Size=10000;"; public void ConnDB() { SqlConnection objConn = new SqlConnection(); // objConn.ConnectionString = "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\MYDBSQL.mdf;User Instance=true"; objConn.ConnectionString = "Data Source=192.168.0.66;Initial Catalog=Ddxt;Persist Security Info=True;User ID=sa;Password=1;Pooling=True;Max Pool Size=10000;"; objConn.Open(); } public string ConnString() { string connstr = connectionString; return connstr; } /// /// 根据SQL语句指定条件记录值绑定到input type="text" id="sDemp" list="sDemplist" 对应list ,by 版权所有:广东松山职业技术学院计算机系 刘友生(QQ:290578102,Tel:15089879808) /// /// /// /// /// /// public StringBuilder HTML5SQLBindRecValueToDDL(string BindFileName, string sSQL) {//将字段BindFileName绑定到myDropDownList StringBuilder sb = new StringBuilder(); //string SQL = "select DISTINCT(" + BindFileName + ") from " + TableName; string SQL = sSQL; SqlConnection dtConn = new SqlConnection(connectionString); SqlDataAdapter dtCmd = new SqlDataAdapter(SQL, dtConn); ; DataSet dtSet = new DataSet(); dtCmd.Fill(dtSet); DataTableReader objreader = dtSet.CreateDataReader(); while (objreader.Read()) { sb.Append("