473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Input string was not in a correct format. (VB.net)

1
Hi,

I am in the middle doing my school work however i having some error with my code but i run this similar code in my other file and there is no issue. Hope you guys can help me. It's about getting multi datakeyname


Expand|Select|Wrap|Line Numbers
  1.  <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false" Width="100%" AllowPaging="true" OnPageIndexChanging="OnPageIndexChanging2" PageSize="3" CssClass="Grid" DataKeyNames="id, tripidtaking, reqid" > <Columns> <asp:BoundField DataField="fname" /> <asp:BoundField DataField="startptname" HeaderText="Origin" /> <asp:BoundField DataField="endptname" HeaderText="Destination" /> <asp:BoundField DataField="givendate" HeaderText="Date" /> <asp:BoundField DataField="starttime" HeaderText="Agreed Time" /> <asp:BoundField DataField="numperson" HeaderText="NoOfPpl" /> <asp:BoundField DataField="Recurring" HeaderText="Whether Recurring" /> <asp:BoundField DataField="day" HeaderText="Selected Day" /> <asp:BoundField DataField="usertype" HeaderText="Type" /> <asp:BoundField DataField="Cfname" HeaderText="Driver Name" /> <asp:BoundField DataField="cid" HeaderText="Driver ID" /> <asp:BoundField DataField="" HeaderText="" /> <asp:BoundField DataField="" HeaderText="" /> </Columns> </asp:GridView>
  2.  
  3.  
  4.     Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound
  5.  
  6.         Dim row As GridViewRow = e.Row
  7.  
  8.         If row.RowType = DataControlRowType.DataRow Then
  9.             'Below 1 is userid, remember to change to userid variable
  10.             If row.Cells(10).Text = reqid Then
  11.  
  12.                 Dim lb As New LinkButton()
  13.                 lb.ID = "lbEnd"
  14.                 lb.Text = "End"
  15.                 lb.CommandName = "EndRow"
  16.                 lb.CommandArgument = DataBinder.Eval(row.DataItem, "tripidtaking") + "," + DataBinder.Eval(row.DataItem, "reqid")
  17.  
  18.                 row.Cells(12).Controls.Add(lb)
  19.  
  20.             ElseIf row.Cells(10).Text <> reqid Then
  21.  
  22.  
  23.  
  24.             End If
  25.         End If
  26.  
  27.     End Sub
I not sure why this error happen upon loading of the page i got this error
Feb 17 '16 #1
0 1639

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: lianfe_ravago | last post by:
Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the...
1
by: Big E | last post by:
Here is my code below. I recieve this error when I run MyCommand.SelectCommand.ExecuteNonQuery() Thanks. Big E Sub MyDataGrid_Update(ByVal Sender As Object, ByVal E As...
5
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string...
1
by: amitbadgi | last post by:
Welcome back amitbadgi | Logout | Faq Knowledge Discovery Keys COMPUTER PROGRAMMING, DATA MINING, STATISTICS, ARTIFICIAL INTELLIGENCE * Settings * Photos * Lists * MVPs * Forums * Blogs
1
by: amitbadgi | last post by:
I am gettign this error, while migration an app to asp.net Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 19: Dim enddate =...
3
by: dan | last post by:
I am using VB.NET 2003 and SQL Server 2000. The program uses ADO.NET . The following instruction: Me.cd_insertDataRecord.ExecuteNonQuery() throws this exception: ">>>ProcessDataRecord/...
0
by: sehguh | last post by:
Hiya Folks, I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005. The main page consists of an aspx page and a master page. The page also...
1
by: sehguh | last post by:
Hello folks I have recently been studying a book called "sams teach yourself asp.net 2.0 in24 hours by scott mitchell. I have reached page 614 but when i tried to run an asp page called...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
2
by: Mark S | last post by:
I am installing a progam called Centennal Discovery for software and hardware inventory on our network. It has a web interface to view results with graphs and such. After installation, I try to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.