BC30390: 'System.Data.SqlClient.SqlDataReader.Private Overloads Sub New(command As System.Data.SqlCl

  • Thread starter Thread starter luke
  • Start date Start date
L

luke

this is the code im using:
Sub Button2_Click(sender As Object, e As EventArgs)

dim cn as new system.data.sqlclient.sqlconnection()
dim cmd as new system.data.sqlclient.sqlcommand()
cn.connectionstring = "Password=PASSWORD;Persist Security
Info=True;User ID=sa;Initial Catalog=Booksdata;Data
Source=LUKES-COMPUTER\INSTANCENAME"
cn.open
dim sqlreader as new system.data.sqlclient.sqldatareader()
cmd.commandtext = "Select isbn, title, author, publisher, ISBN, Pages,
Price, Description from books where isbn = '" & txtisbnSearch.text &
"'"
sqlreader = comm.executereader
if sqlreader.read() then
txtISBN = sqlreader("isbn")
txttitle = sqlreader("title")
txtPublisher = sqlreader("Publisher")
txtnumofpages = sqlreader("NumofPages")
txtprice = sqlreader("Price")
txtdescription = sqlreader("Description")
else
label1.text = "Failed to find a book with chosen ISBN"
label1.backcolor = 255
end if
End Sub

Sub TextBox1_TextChanged(sender As Object, e As EventArgs)

End Sub


any hints and tips to sort out any error messages i might get
 
Back
Top