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
Nirmal Roy
NA
365
29.4k
Datagrid Bind error
Aug 23 2016 9:06 AM
private void bindfunction()<br /> {<br /> int i = 0; int j=0;<br /> SqlDataAdapter da = new SqlDataAdapter(@"select distinct Sectiontype, Questiontype,Subject from dbo.tbl_QuestionConfig where Subject='C++'", con);<br /> DataTable dt = new DataTable();<br /> da.Fill(dt);<br /> if (dt.Rows.Count > 0)<br /> {<br /> for (i = 0, j = 0; i < dataRepeater1.ItemCount && j < dt.Rows.Count; i++,j++)<br /> {<br /><br /> // Label txtExample = (Label)dataRepeater1.Controls.Find("label1", true).First();<br /> //if (txtExample != null)<br /> //{<br /> SqlDataAdapter daa = new SqlDataAdapter(@"select Question,Fullmarks from dbo.tbl_QuestionConfig where Sectiontype='" + dt.Rows[i]["Sectiontype"].ToString() + "' and Questiontype='" + dt.Rows[i]["Questiontype"].ToString() + "' and Subject='" + dt.Rows[i]["Subject"].ToString() + "'", con);<br /> DataTable dtt = new DataTable();<br /> daa.Fill(dtt);<br /> dataGridView1.DataSource = dtt;<br /> dataGridView1.AutoGenerateColumns = false;<br /> dataGridView1.EnableHeadersVisualStyles = false;<br /> dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSeaGreen;<br /> foreach (DataGridViewRow r in dataGridView1.Rows)<br /> {<br /> r.DefaultCellStyle.BackColor = Color.LightCyan;<br /> }<br /> <br /> }<br /> }<br /> <br /><div> }</div><div> </div><div> </div><div> frist time page load datagrid is null ?? no data found in datagrid in widows application.</div><div> </div><div> </div>
Reply
Answers (
7
)
Binary file through C#
Visual Studio's Debugger Randomly Quit Working