日期:2014-05-20 浏览次数:20417 次
protected object AjaxTextBox1_Search(object sender, HampWebControl.AjaxTextBox.SearchEventArgs e) { String connStr = @"server=PC-200902201516\SQLEXPRESS;database=IPSystem;uid=sa;pwd=123456"; String sql = "select id,name from person where name like '%"+e.Text.Trim()+"%'"; using (SqlConnection conn = new SqlConnection(connStr)) { conn.Open(); SqlCommand sd = new SqlCommand(sql, conn); SqlDataAdapter sa = new SqlDataAdapter(sd); DataTable dt = new DataTable(); sa.Fill(dt); return dt; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HampToolTip1.ControlToTip = Label1.ClientID; } }