VB.NET ASP.NET prob

  • Thread starter Thread starter jophrthomas
  • Start date Start date
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...
 
string connection;
connection = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\Inetpub\\wwwroot\\xxx\\Daten\\Test.mdb";
OleDbConnection oConn = new OleDbConnection(connection);
try
{
oConn.Open();


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top