This method is returning only single value,
but it has to be multiple.
What should I do?
private string getImage_ID()
{
MySqlConnection con = new MySqlConnection(constr);
con.Open();
string query = "Select Arrive_Img_ID,Leave_Img_ID from register where Students_ID='" + getStudent_ID() + "'";
MySqlCommand cmd = new MySqlCommand(query);
cmd.Connection = con;
MySqlDataReader reader = cmd.ExecuteReader();
string i = reader.ToString();
while (reader.Read())
{
i = reader["Arrive_Img_ID"].ToString();
}
reader.NextResult();
while (reader.Read())
{
i = reader["Leave_Img_ID"].ToString();
}
reader.Close();
return i;
}
Please in asp.net.
Single to multiple
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 22, 2015, 10:33 PM EDT