Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- {
- SqlConnection cn = new SqlConnection(@"Data Source=(LocalDB)v11.0;AttachDbFilename=E:Documentsbasededadospap.mdf;Integrated Security=True;Connect Timeout=30");
- try
- {
- cn.Open();
- string query = "select * from fornecedor where nomefornecedor='" + comboBox1 + "'";
- SqlCommand createCommand = new SqlCommand(query, cn);
- SqlDataReader dr = createCommand.ExecuteReader();
- cn.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement