Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input string was not in a correct format

Status
Not open for further replies.

paulhudson

Programmer
Jan 20, 2005
8
GB
I am attempting to use FindControl on datarow but keep getting the following error:

Input string was not in a correct format

The column is created thus:
<code>
tpDataColumn = New DataColumn()
tpDataColumn.DataType = System.Type.GetType("System.Int32")
tpDataColumn.ColumnName = "UniqueID"
tpDataColumn.ReadOnly = True
tpDataColumn.Unique = True
tpDataColumn.AutoIncrement = True
</code>

And the find command is (error on last line):

<code>
Dim KeyID As Int32
KeyID = CType(e.Item.FindControl("UniqueID"), Label).Text
Dim foundRow As DataRow
foundRow = dtTeamPlayers.Rows.Find("KeyID")
</code>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top