Need string to label
- InitializeComponent();
- korisnickoImeLabel.Text = getKorisnickoIme();
What I wrong?
Query is ok
- private String getKorisnickoIme()
- {
- SqlConnection myConnection = new SqlConnection(cs);
- String value = "SELECT ime_prezime FROM osobe_korisnici WHERE id='" + korisnikId + "'";
- SqlCommand cmd = new SqlCommand(value, myConnection);
- myConnection.Open();
- SqlDataReader rdr = cmd.ExecuteReader();
- return value;
- }
SELECT ime_prezime FROM osobe_korisnici WHERE id='10'
id is 10, but I need to write in label name and surname for user (ime_prezime)
Sumit ChaudharyPosted May 24, 2018, 5:57 AM
Goran BibicPosted May 24, 2018, 3:39 AM
Sumit ChaudharyPosted May 24, 2018, 3:30 AM