Advertisement
Guest User

Untitled

a guest
Apr 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. var select = "select cardnumber,[status],cp.name_series,print_name,print_surname,embg_user from cards_issued c join card_products cp on c.idproduct=cp.idproduct where embg_user='" + txtembg.Text + "'";
  2. var c = new SqlConnection("Data Source=WIN-3QUAK81995Q;Initial Catalog=lt-2;Persist Security Info=True;User ID=lt-2;Password=lt-2P@ssw0rd"); // Your Connection String here
  3. var dataAdapter = new SqlDataAdapter(select, c);
  4.  
  5. var commandBuilder = new SqlCommandBuilder(dataAdapter);
  6. var ds = new DataSet();
  7. dataAdapter.Fill(ds);
  8. dataGridView1.ReadOnly = true;
  9. dataGridView1.DataSource = ds.Tables[0];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement