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
ToBe
NA
164
94.4k
Invalid attempt to read when no data is present
Feb 28 2013 7:50 AM
Hi I have a problem when try to read from database it's always stop the
Debugger and give this msg: "
Invalid attempt to read when no data is present"
and this is my code:
SqlDataReader dr;
dr=cmd.ExecuteReader ();
dr.Read();
int xx = int.Parse ( dr[0].ToString());
Response.Write(xx);
dr.Close();
for (i = 0; i < CheckBoxList1.Items.Count; i++)
{
if (CheckBoxList1.Items[i].Selected == true)
{
cmd = new SqlCommand();
cmd.CommandText = "insert into tbltts values ('" +CheckBoxList1.Items[i].Text + "'," + xx + ")";
cmd.Connection = con;
cmd.ExecuteNonQuery();
}
}
con.Close();
}
Reply
Answers (
2
)
gridview download quarie
i want transfer a file over network in shared folder.