| |

VerySource

 Forgot password?
 Register
Search
View: 593|Reply: 2

Data loading error! Object cannot be converted from DBunll to its type. Error number 13 #, it hasn't been done in three

[Copy link]

2

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-19 22:00:01
| Show all posts |Read mode
Data loading error! Object cannot be converted from DBunll to its type. Error # 13 #

Debug runningsun value is OD


Public runningsum As Double
    Private Sub DataGrid2_ItemDataBound (ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid2.ItemDataBound
        'Dim runningSum As Single
        If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

            runningsum + = Convert.ToDouble (DataBinder.Eval (e.Item.DataItem, "jshj"))

        ElseIf e.Item.ItemType = ListItemType.Footer Then
 'e.Item.Cells (3) .Text = "<b> Signed total amount: </ b>" + String.Format ("{0: c}", runningsum)
 End If

    End Sub
Reply

Use magic Report

2

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-4-27 18:30:01
| Show all posts
The value of debugging runningsun is OD, the actual value is 60
Reply

Use magic Report

0

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-4-27 20:15:01
| Show all posts
You can try it like this
Assuming the field strtmp is DBNull
You can write strtmp as strtmp.tostring (don't care if there is no display prompt), you can convert DBNull to "" (null character)
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list