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
Chevy Mark Sunderland
NA
188
167.3k
[C# net4] GridView empty
Sep 17 2013 8:12 AM
Hello, hope in your help.
My problem is when the GridView is empty in the aspx page I've this error:
Object reference not set to an instance of an object on:
protected void OnDataBound(object sender, EventArgs e)
{
sql = "SELECT ";
sql = sql + " denom
sql = sql + "FROM ";
sql = sql + " tbl_xxx; ";
DropDownList Newcombo = DecoderView.FooterRow.FindControl("Newcombo") as DropDownList;
Newcombo.DataSource = GetData(sql);
Newcombo.DataTextField = "denom";
Newcombo.DataValueField = "denom";
Newcombo.DataBind();
Newcombo.Items.Insert(0, new ListItem("------", ""));
}
in this line:
DropDownList Newcombo = DecoderView.FooterRow.FindControl("Newcombo") as DropDownList;
If I've gridview records to show the aspx page is working ...
Can you help me?
Thank you in advance
Attachment:
cs.zip
Reply
Answers (
2
)
Join DB using c#
mark entry form issue in web form