Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

replacing combobox with checkedlistbox for multiple search

$
0
0

hello there,

i am working on a c# project. backend sql 2008. There is a search button earlier which takes the booth no (column in sql table) from a combobox. Now my client want that i use checkedlist box so that he can select multiple booth nos from and den get the output. i m not able to do dat. please me out ..its urgent. I am mentioning the code for searching from textbox. find it below

private void button1_Click(object sender, EventArgs e)
        {
       
            try
            {
                
                    SqlConnection Conn = new SqlConnection(DBSettings.getcon());
                    Conn.Open();

                    SqlDataAdapter DA = new SqlDataAdapter("SELECT * FROM TABLE3 where booth_no =" +combo_booth1.Text , Conn);
                    DataTable dt = new DataTable();
                    DA.Fill(dt);

                    if (Conn.State == ConnectionState.Open)
                    {
                        Conn.Close();
                    }

                    BindingSource BS = new BindingSource();
                    BS.DataSource = dt;
                    DG1.DataSource = BS;
                    //DG.BindingSource = BS;
                    lbl_row.Text = grid_Total_row();

                }

                
            
            catch (Exception dd)
            {
                MessageBox.Show("Error \n " + dd.Message,
                                     " Gold Star Communications"
                                     , MessageBoxButtons.OK
                                     , MessageBoxIcon.Error);

            }
        }


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>