G
Guest
I have the following in ASP, and it works fine unless I change the SELECT ID
field to something else that isn't an integer. In other words, if I change
ID to city it doesn't work, and the only connection I can make is that my
bind only accepts integers, can someone help me?
Dim dstProducts As DataSet
Dim dadProducts As SqlDataAdapter
Label1.Visible = False
dstProducts = New DataSet()
Dim conPubs as SqlConnection
conPubs = New
SqlConnection("Server=LENVSQL;uid=itam;pwd=agenda;database=Discovery")
conPubs.Open()
dadProducts = New SqlDataAdapter( "SELECT ComputerName, IPAddress,
SerialNo FROM Computer WHERE ID = " & TextBox1.Text, conPubs)
Try
dadProducts.Fill( dstProducts, "Computer") 'the error occurs here
if ID is changed to City
dgEmployee.DataSource = dstProducts
dgEmployee.DataBind()
dgEmployee.Visible = True
field to something else that isn't an integer. In other words, if I change
ID to city it doesn't work, and the only connection I can make is that my
bind only accepts integers, can someone help me?
Dim dstProducts As DataSet
Dim dadProducts As SqlDataAdapter
Label1.Visible = False
dstProducts = New DataSet()
Dim conPubs as SqlConnection
conPubs = New
SqlConnection("Server=LENVSQL;uid=itam;pwd=agenda;database=Discovery")
conPubs.Open()
dadProducts = New SqlDataAdapter( "SELECT ComputerName, IPAddress,
SerialNo FROM Computer WHERE ID = " & TextBox1.Text, conPubs)
Try
dadProducts.Fill( dstProducts, "Computer") 'the error occurs here
if ID is changed to City
dgEmployee.DataSource = dstProducts
dgEmployee.DataBind()
dgEmployee.Visible = True