Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Public Sub binddata()
        Try
            Dim itemid1 As Int64 = Integer.Parse(Request.QueryString("itemid").ToString)
            Dim drmember As DataRow = ItemMaster.ItemMaster_ById(itemid1)

            If Methods.CorrectDBNull(drmember.Item("item_name")).ToString() <> "" Then
                txtimage.Text = Methods.CorrectDBNull(drmember.Item("item_name")).ToString()
            End If
        Catch ex As Exception

        End Try
    End Sub







**** The error comes from the "dim itemid1 asint64" line.****
What is the solution?
Posted
Comments
[no name] 24-Apr-14 6:35am    
see quickwatch which type of value is coming to "Request.QueryString("itemid")" is it int type value or not ?
If not then send only int value

Seems like your Request.QueryString("itemid") is empty/null.
 
Share this answer
 
Ensure that Request.QueryString("itemid") is actually an integer that can be converted directly into an integer.
For e.g. an itemid of E55 cannot be converted into an integer directly.

Integer.TryParse[^] will help you check if the value is parse is actually an integer or not.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900