|
| access datasource |
 |
Tue, 25 Mar 2008 23:25:18 +000 |
Hi,
I want to assign a path to the access datasourcefrom my web.config file.
I have done this but don't know what is wrong plz help
AccessDataSource2.DataFile=New
Data.OleDb.OleDbConnection(System.Configuration.ConfigurationManager.AppSettings
("connectionstring"))
plz reply asap....
Thanks all....
|
| Post Reply
|
| Re: access datasource |
 |
Tue, 25 Mar 2008 23:36:21 +000 |
Use this intead.
ConfigurationSettings.AppSettings("connectionstring")
or
ConfigurationManager.ConnectionStrings("connectionstring").ConnectionS
tring
|
| Post Reply
|
| Re: access datasource |
 |
Tue, 25 Mar 2008 23:43:11 +000 |
Hi,
do i do it like
accessdatasource1.datafile=New
Data.OleDb.OleDbConnection(System.Configuration.ConfigurationManager.ConnectionS
trings("connectionstring").ConnectionString)
regards
|
| Post Reply
|
| Re: access datasource |
 |
Tue, 25 Mar 2008 23:53:18 +000 |
I didn't realize that you are assigning it to DataFile. The DataFile property
accepts a path to the datafile. So in this case, you might have to do something
like this:
<appSettings>
<add key="connectionstring"
value="~\folder\database.mdb" />
</appSettings>
And then,
AccessDataSource2.DataFile =
ConfigurationSettings.AppSettings("connectionstring")
|
| Post Reply
|
| Re: access datasource |
 |
Wed, 26 Mar 2008 00:01:27 +000 |
sorry that didnt work as well
i did AccessDataSource2.DataFile =
ConfigurationSettings.AppSettings("connectionstring")
regards
|
| Post Reply
|
|
|
|
|
|
|
|
|
|