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
Zakir Ahamed
NA
1.4k
627.8k
Enumaration yielded no results
Jul 25 2017 2:49 AM
hi friends
i have prblm in datareader in result view i am gettin following error message:
Enumaration yielded no results
the following code:
if (txtcategory.Text != " ")
{
try
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RetailTestConnection"].ConnectionString);
con.Open();
string query = String.Format("Select B.BrandId from Brand_Mst B JOIN Category_brand_Tbl cb on B.BrandId = cb.BrandId JOIN Category_Mst c on c.CategoryId = cb.CategoryId Where c.categoryname = '{0}'",txtcategory.Text);
SqlCommand cmd = new SqlCommand(query,con);
SqlDataReader
dr
= cmd.ExecuteReader();
string[] s = new string[] { };
while (dr.Read())
{
s = dr.ToString().Split(',');
}
int Length = s.Length;
for (int i = 0; i < Length; i++)
// for (int i = 0; i <= 1; i++)
{
string fetr = s[i];
for (int j = 0; j <= clbbrand.Items.Count - 1; j++)
{
if (clbbrand.Items[j].ToString() == s[i])
{
clbbrand.SetItemChecked(j, true);
break;
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if any one knows help me how to getting data
Reply
Answers (
2
)
How to get the Appendix Style like Table of Contents in VSTO
how to block previous dates from datetime picker in windows