User1717218719 posted
I have the following code:
I am looking to get the trn column value if the tktdoc number is = tot the value in the textbox. I am not sure how to get the. there are many mistakes in my code im sure but this is my initial attempt
objTrnID in my code. any help would be great.
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim strTktNbr = txtSearch.Text
Dim objTrnID As Object = GetTrnID(strTktNbr)
If Not IsDBNull(objTrnID) Then
Call GetTrnsHeadDataBase(CInt(objTrnID)) '--Trn ID
End If
Public Function GetTrnID(ByVal objTrnID As Object) As Object
conConn = New SqlConnection(GblSqlCon)
'--Read from Database
comComm = New SqlCommand
With comComm
.Connection = conConn
.CommandType = CommandType.Text
.CommandText = "Select * " &
"From tbl" &
"WHERE (TktID = TktID) AND (TrnID = TrnID)"
.Parameters.AddWithValue("@TktID", txtSearch.Text)
.Parameters.AddWithValue("@TrnID", objTrnID)
End With
' If Not String.IsNullOrEmpty(txtSearch.Text) Then
' Return objTrnID
' Else
' Return Nothing
' End If
End Function