Пример #1
0
        private void Update_Load(object sender, EventArgs e)
        {
            DataSet   ds = SqlDesigner.ExecuteDataSet("select * from Ls_Mms_Info");
            DataTable dt = ds.Tables[0];

            dataGridView1.DataSource = dt;
        }
Пример #2
0
        //查询
        private void button3_Click(object sender, EventArgs e)
        {
            string sql = "select * from Ls_Mms_Info where 1 = 1";

            if (textBox1.Text.Trim() != "")
            {
                sql = sql + " and info = '" + textBox1.Text + "' ";
            }
            if (textBox2.Text.Trim() != "")
            {
                sql = sql + " and more = '" + textBox2.Text + "' ";
            }
            if (textBox3.Text.Trim() != "")
            {
                sql = sql + " and name = '" + textBox3.Text + "' ";
            }


            DataSet   ds = SqlDesigner.ExecuteDataSet(sql);
            DataTable dt = ds.Tables[0];

            dataGridView1.DataSource = dt;
        }