I've create a function that search the datas fom a txtbox,however don't know how to check the input type of txtBox
vInput = txtRecherche.Text
NbCol = dt.Columns.Count
NbRow = dt.Rows.Count
For iVar As Integer = 0 To NbCol - 1
Dim type As String = dt.Columns(iVar).DataType.Name
If IsNumeric(vInput) Then
'here I want to check on vInput if is Integer '
Try
Dim a As Integer = Integer.Parse(vInput)
SearchExpression &= dt.Columns(iVar).ColumnName & " = " & vInput & " or "
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
'checking on vInput if is decimal '
End If
Wolfoo
0 Points
14 Posts
type Of textbox
May 07, 2012 02:24 PM|LINK
I've create a function that search the datas fom a txtbox,however don't know how to check the input type of txtBox
vInput = txtRecherche.Text NbCol = dt.Columns.Count NbRow = dt.Rows.Count For iVar As Integer = 0 To NbCol - 1 Dim type As String = dt.Columns(iVar).DataType.Name If IsNumeric(vInput) Then 'here I want to check on vInput if is Integer ' Try Dim a As Integer = Integer.Parse(vInput) SearchExpression &= dt.Columns(iVar).ColumnName & " = " & vInput & " or " Catch ex As Exception MsgBox(ex.Message) End Try Else 'checking on vInput if is decimal ' End If