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 ChaudharyRank #3,483 · 416 reputationPosted May 24, 2018, 1:57 AM EDT
Sumit ChaudharyRank #3,483 · 416 reputationPosted May 23, 2018, 11:30 PM EDT
Goran BibicRank #993 · 2K reputationPosted May 23, 2018, 11:39 PM EDT