abdujalil  chuliev

abdujalil chuliev

  • NA
  • 400
  • 41.3k

scalar to reader

Aug 16 2015 2:58 AM
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)