Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

Input String was not in correct format

$
0
0
Hi,

I receive the error;

Input string was not in a correct format..
Line 1270: Dim fileID As Integer = Convert.ToInt32(lnkDel.HRef)


Code:

Protected Sub lnkDelFile_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim lnkDel As HtmlAnchor = DirectCast(sender, HtmlAnchor)
        Dim fileID As Integer = Convert.ToInt32(lnkDel.HRef)

        Dim strQuery As String = "Delete * from dbo.tblFiles where fileid=@fileid"
        Dim cmd As SqlCommand = New SqlCommand(strQuery)

        cmd.Parameters.Add("@fileid", SqlDbType.Int).Value = Fileid


    End Sub

Many Thanks

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>