Advertisement
Velja_Programer

Prikazivanje

Jun 7th, 2020
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1.  private void textBox1_TextChanged(object sender, EventArgs e)
  2.         {
  3.             string k = "select * from Glumac where GlumacId=" + textBox1.Text;
  4.  
  5.             try
  6.             {
  7.                 con.Open();
  8.                 SqlCommand cmd = new SqlCommand(k, con);
  9.                 SqlDataReader dr = cmd.ExecuteReader();
  10.                 while(dr.Read())
  11.                 {
  12.                     textBox2.Text = dr[1].ToString();
  13.                     textBox3.Text = dr[2].ToString();
  14.                     textBox4.Text = dr[3].ToString();
  15.                    
  16.                 }
  17.                
  18.             }
  19.             catch (Exception ex)
  20.             {
  21.                 MessageBox.Show(ex.Message);
  22.                 throw;
  23.             }
  24.             finally
  25.             {
  26.                 if (con.State == ConnectionState.Open) con.Close();
  27.                 osvezi();
  28.             }
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement