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
Danish Habib
NA
694
243.5k
getting error on databinder.eval
Apr 29 2015 3:30 PM
I have table some of the columns having integer values and some rows are empty when i am using that code to show the sum of a specific column it gives error because it find a row with nothing and this column is integer type below is the code i have tried many option no one work for me ..
Private Sub grdUserReports_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdUserReports.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim rowTotal As Integer = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Target"))
If rowTotal <> 0 Then
grdTotal = grdTotal + rowTotal
End If
End If
If e.Row.RowType = DataControlRowType.Footer Then
Dim lbl As Label = DirectCast(e.Row.FindControl("lblTotal"), Label)
lbl.Text = grdTotal.ToString("c")
End If
End Sub
Reply
Answers (
1
)
Find dependent table in entity framework c#
Error Ado.Net/ Sql/C# need help please