Unable to Locate

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

can someone help me, please? I have the following set on asp with VB code.

Dim dstProducts As DataSet
Dim dadProducts As SqlDataAdapter

dadProducts = New SqlDataAdapter( "SELECT ComputerName, IPAddress, SerialNo
FROM Computer WHERE ID = " & TextBox1.Text, conPubs)

It works fine up to here

dadProducts.Fill( dstProducts, "Computer")
dgEmployee.DataSource = dstProducts
dgEmployee.DataBind()

and then I get an error on dadProducts.Fille(dstProducts, "Computer"). It
only ocurrs if I change the field ID to some other field that is not an
integer. Is this a VB.NET limitation?
 
Most likely, the "other field", if not an numeric value, is either text
value, or date value. In SQL Statement, they should be place in a pair of
('), like this:

"SELECT ...FROM...WHERE fieldName='" & TextBox1.Text & "'"
 
Back
Top