Connecting Tech Pros Worldwide Help | Site Map

VB.NET ASP.NET prob

jophrthomas
Guest
 
Posts: n/a
#1: Nov 18 '05
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.AppSet tings
("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.AppSet tings
("G:\intouch"))
....i think i am doin somethin wrong here...can someone pls
help????tks...
Jim Cheshire [MSFT]
Guest
 
Posts: n/a
#2: Nov 18 '05

re: VB.NET ASP.NET prob


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
jamesche@online.microsoft.com

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

--------------------[color=blue]
>Content-Class: urn:content-classes:message
>From: "jophrthomas" <anonymous@discussions.microsoft.com>
>Sender: "jophrthomas" <anonymous@discussions.microsoft.com>
>Subject: VB.NET ASP.NET prob
>Date: Mon, 22 Dec 2003 20:48:46 -0800
>Lines: 40
>Message-ID: <060101c3c910$0c7611f0$a301280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Thread-Index: AcPJEAx2seyMYMFuTEeQ+3uAlkYg0w==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Path: cpmsftngxa07.phx.gbl
>Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:197884
>NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>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.AppSe ttings
>("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.AppSe ttings
>("G:\intouch"))
>...i think i am doin somethin wrong here...can someone pls
>help????tks...
>[/color]

Jim Cheshire [MSFT]
Guest
 
Posts: n/a
#3: Nov 18 '05

re: VB.NET ASP.NET prob


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
jamesche@online.microsoft.com

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

--------------------[color=blue]
>Content-Class: urn:content-classes:message
>From: "jophrthomas" <anonymous@discussions.microsoft.com>
>Sender: "jophrthomas" <anonymous@discussions.microsoft.com>
>Subject: VB.NET ASP.NET prob
>Date: Mon, 22 Dec 2003 20:48:46 -0800
>Lines: 40
>Message-ID: <060101c3c910$0c7611f0$a301280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Thread-Index: AcPJEAx2seyMYMFuTEeQ+3uAlkYg0w==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Path: cpmsftngxa07.phx.gbl
>Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:197884
>NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>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.AppSe ttings
>("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.AppSe ttings
>("G:\intouch"))
>...i think i am doin somethin wrong here...can someone pls
>help????tks...
>[/color]

Closed Thread