html5 - Input string in correct format. VB.net - New to this so help required -
i having issues page , code behind working on. please see code:
protected sub page_load(sender object, e eventargs) handles me.load dim dttable datatable = nothing dim intconnectionid integer = 0 if page.ispostback ' user data session httpcontext.current intconnectionid = cint(result.value) end end if ' remove connection modconnections.delete(intconnectionid) ' clear desks attahced connection moddesktext.clearuserdesk(intconnectionid) using sqlcommand new sqlcommand sqlcommand .commandtext = "usp_connectsdetailedlist" .commandtype = commandtype.storedprocedure end execute(sqlcommand, dttable) end using rep1 .datasource = dttable.defaultview .databind() end if not isnothing(dttable) dttable.dispose() end if end sub [formatexception: input string not in correct format.] microsoft.visualbasic.compilerservices.conversions.parsedouble(string value, numberformatinfo numberformat) +213 microsoft.visualbasic.compilerservices.conversions.tointeger(string value) +90 [invalidcastexception: conversion string "" type 'integer' not valid.] microsoft.visualbasic.compilerservices.conversions.tointeger(string value) +238 frmconnects2.page_load(object sender, eventargs e) in d:\source code\pts\pts online .net - copy\pts online .net\pts online .net stu\frmconnects2.aspx.vb:17 system.web.ui.control.onload(eventargs e) +95 system.web.ui.control.loadrecursive() +59 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +678
on line:
intconnectionid = cint(result.value)
i getting above error. no matter cannot data convert format need work. understand has nothing right hand side code.
my goal data table, place in text box (<input type="text" id="result" runat="server" />
) id="result" , use "id" of record selected in sql remove connection. see table below:
<itemtemplate> <tr class="<%# returnvaluesascolor(eval("online"), eval("mobile"), eval("server_proc"))%>"> <td><%# eval("id").tostring%></td> <td><%# eval("user_id").tostring%></td> <td><%# eval("user_name").tostring%></td> <td><%# eval("workstation_name").tostring%></td> <td><%# eval("ip_address").tostring%></td> <td><%# eval("connect_date").tostring%></td> <td><%# eval("refresh_date").tostring%></td> <td><%# eval("app_ver").tostring%></td> <td><%# eval("app_date").tostring%></td> <td><%# cbool(eval("get_messages_flag")).tostring%></td> <td><%# fixnumbers(eval("message_type_flags"))%></td> <td><%# eval("online").tostring%></td> <td><%# eval("mobile").tostring%></td> <td><%# eval("group_name").tostring%></td> <td><%# eval("server_proc").tostring%></td> <td><input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all" value="delete connection" onclick="cleartext(result); copyid(<%# eval("id").tostring%>);" /></td> </tr> </itemtemplate>
js used:
<script> function copyid(num) { var txt = document.getelementbyid("<%= result.clientid%>").value; txt = num; document.getelementbyid("<%= result.clientid%>").value = txt; } </script>
sorry if missed or there lack of info. appreciated.
you haven't shown definition result
or result.value
educated guess.
try testing null value in database:
if isdbnull(result.value) intconnectionid = 0 else intconnectionid = cint(result.value) end if
Comments
Post a Comment