4
Reply

scalar to reader

abdujalil  chuliev

abdujalil chuliev

Aug 16 2015 2:58 AM
368
How can I change this code from MySqlDataScalar to DataReader.
Because I need multiple ID values.
I tried to relate dropdownlist to gridview which contains Byte[] img.
But there is only one image.
Here is my code:

private string getImage_ID1()
{
MySqlConnection con = new MySqlConnection(constr);
con.Open();
MySqlCommand cmd = new MySqlCommand("Select bosh_rasm_ID,Tugal_rasm_ID from uqishkunlari where uquvchilar_ID='" + getStudent_ID1() + "'");
cmd.Connection = con;
string reader =(cmd.ExecuteScalar() ?? String.Empty).ToString();
return reader;
}

Answers (4)