TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abdujalil chuliev
NA
400
41.4k
foreach
Sep 4 2015 6:38 AM
Hello, the method given below is returning value only from the last rows
of Arrive_Img_ID and Leave_Img_ID. But four image ID exist in each column.
What should I do?
private string getImage_ID()
{
MySqlConnection con = new MySqlConnection(constr);
con.Open();
MySqlCommand cmd = new MySqlCommand("Select Arrive_Img_ID,Leave_Img_ID from register where Students_ID='" + getStudent_ID() + "'");
cmd.Connection = con;
MySqlDataReader reader = cmd.ExecuteReader();
string i = null;
while (reader.Read())
{
foreach (DbDataRecord s in reader)
{
i = reader["Arrive_Img_ID"].ToString();
i = reader["Leave_Img_ID"].ToString();
}
}
reader.Close();
return i;
}
Reply
Answers (
6
)
How to delete Server Side FOLDERS in asp.net..?
Have an issue in Entity Framework Code First