Trying to get table contents into textBoxes seperately by the prefered ID number when button_click event occours. I've found some videos about the situation but dataGrids were used in those. I'm a complete newbie in C# btw, and i'm not even sure what i'm doing.
Question is, i cant figure how to write a read-only object that is stated below in code into a textBox. I'm %90 sure that it's truly a simple thing, and i'm missing it.
private void button2_Click(object sender, EventArgs e)
SqlCommand rcmd = new SqlCommand("SELECT ID, Column1, Column2 FROM [TEST].[dbo].[Table_1] where ID=@ID", connection);
SqlDataReader reader = rcmd.ExecuteReader();
//textBox4.Text = reader["Column1"];
//textBox5.Text = reader["Column2"];
//These wont work, says reader["Column1"] and reader["Column2"] are read-only. What to do?