E
Eduardo@Merritt Island
I am using ASP.Net 2005
I transcribe a simple code that I have from 2003 and
the system gives me the following error
ExecuteScalar: Connection property has not been initialized.
This is my code:
Dim conUsers As OleDbConnection
Dim strSelect As String
Dim cmdUsers As New OleDbCommand
conUsers = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\HomeWeb\App_Data\Home_website.mdb")
strSelect = ("select Position from security where User=? and Password =?")
cmdUsers.Parameters.AddWithValue("@user", TextBox1.Text)
cmdUsers.Parameters.AddWithValue("@Password", TextBox2.Text)
conUsers.Open()________________________________ERROR OCCURS HERE
Label6.Text = cmdUsers.ExecuteScalar.ToString
conUsers.Close()
I have no problem using it in VB
I would appreciate if any one has run into this problem when connecting to
Access
Thank you for any Assistance
I transcribe a simple code that I have from 2003 and
the system gives me the following error
ExecuteScalar: Connection property has not been initialized.
This is my code:
Dim conUsers As OleDbConnection
Dim strSelect As String
Dim cmdUsers As New OleDbCommand
conUsers = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\wwwroot\HomeWeb\App_Data\Home_website.mdb")
strSelect = ("select Position from security where User=? and Password =?")
cmdUsers.Parameters.AddWithValue("@user", TextBox1.Text)
cmdUsers.Parameters.AddWithValue("@Password", TextBox2.Text)
conUsers.Open()________________________________ERROR OCCURS HERE
Label6.Text = cmdUsers.ExecuteScalar.ToString
conUsers.Close()
I have no problem using it in VB
I would appreciate if any one has run into this problem when connecting to
Access
Thank you for any Assistance