casting
hello
I have retrived some data from database. Now I want to compare that data with my string value. Although the data retrived and my string value are same and the if condition is true but still it doesnt execute the code inside the if condition.
I think there is some problem with casting. The code is as follows:
mycommand = New SqlCommand("select balqtyp, balqtyc, partida, Description from inwards where partida = (select min(partida) from inwards where model_no = '" + modelno + "' and warehouse = '" + warehouse1 + "')", con)
mycommand.Connection = con
dr = mycommand.ExecuteReader()
Dim pallets, cajas, partida, description As String
Do While dr.Read
pallets = dr.Item("balqtyp")
cajas = dr.Item("balqtyc")
partida = dr.Item("partida")
description = dr.Item("description")
Loop
warehouse1 = warehouse1.TrimEnd
warehouse1 = warehouse1.TrimEnd
warehouse1 = warehouse1.Trim
If warehouse1.Equals("polistock") = True Then
rbpolistock.Checked = True
rbmasdatran.Enabled = False
rbnaypemar.Enabled = False
rbnihal.Enabled = False
end if
please help me. Thanx a lot in advance.
|