VB.NET ASP.NET prob

J

jophrthomas

hi...i am getting a error here...saying :
**quote**
The ConnectionString property has not been initialized.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.InvalidOperationException: The
ConnectionString property has not been initialized.
**quote**

i am tryign to connect to a Access db to retieve info to a
repeater using VB.NET...
i dont how to initailize the connection...
i am doin it like so :
<code>
Dim DS As DataSet
Dim MyConnection As New
System.Data.SqlClient.SqlConnection()
Dim MyCommand As
System.Data.SqlClient.SqlDataAdapter

MyConnection = New
System.Data.SqlClient.SqlConnection
(System.Configuration.ConfigurationSettings.AppSettings
("G:\intouch"))
MyCommand = New
System.Data.SqlClient.SqlDataAdapter("select * from
UserID", MyConnection)

DS = New DataSet()
MyCommand.Fill(DS, "UserID")
</code>
i think the prblem lies in here :
MyConnection = New System.Data.SqlClient.SqlConnection
(System.Configuration.ConfigurationSettings.AppSettings
("G:\intouch"))
....i think i am doin somethin wrong here...can someone pls
help????tks...
 
J

Jim Cheshire [MSFT]

You have not set the connection string of your connection. In other words,
ADO.NET doesn't have a clue where the database is. :)

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
 
J

Jim Cheshire [MSFT]

One other point. You are trying to use the System.Data.SqlClient provider
to connect to an Access database. This won't work. You will need to use
System.Data.OleDb for any non-SQL Server database system.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top