Hello,
I am new to asp.net i have had some experience making windows in vb.net (VS2010)
I am trying to get my web to query a database then I want to display some of the returned data.
the code I have is..
Imports System.Data.OleDb
Partial Class Demos_Iain
Inherits System.Web.UI.Page
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim con As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = ../SR.mdb"
Dim sql As String
Dim name As String = txtLogin.Text
Dim password As String = txtPwd.Text
sql = "Select * from SRuser where Uname = " & name & " "
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = sql
dbCommand.Connection = con
Dim DA As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
DA.SelectCommand = dbCommand
Dim DS As System.Data.DataSet = New System.Data.DataSet
DA.Fill(DS)
End Sub
End Class
when i run the code it breaks at the DA.Fill(DS)
could anybody point out what I am doing wrong???
Thanks for any help!!!!
Iain