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
Resign Designs
NA
31
30k
How to get rid of out of range error?
May 5 2015 5:57 AM
Hi,
I have this code at page load to and it loads some data from db to form.
try
{
connection.Open();
adapter.SelectCommand = new SqlCommand("select * from mydb order by LangStaticID ASC", connection);
adapter.Fill(ds);
connection.Close();
for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
PageTitle.Text = ds.Tables[0].Rows[0].ItemArray[2].ToString();
MetaTitle.Text = ds.Tables[0].Rows[0].ItemArray[3].ToString();
}
when there are no results it gives me this error
How can I handle this error?
tried with this but no luck
if (ds.Tables[0].Rows.Count == 0)
{
//
}
Thanks
Reply
Answers (
6
)
How to implement autocomplete combobox
want to show dynamically images in Crystal report