---
title: "Connections-problem"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/143391-connections-problem"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "saw"
published: "2006-03-04T19:00:34.000Z"
updated: "2006-03-05T08:55:51.000Z"
replies: 6
views: 403
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/143391-connections-problem"
---

# Connections-problem

## #1 — saw, 2006-03-04T19:00Z

Detta fungerade i ASP.net 1,0

```
'i web.config
<add key="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source= C:\Inetpub\wwwroot\
ASP_Net-Test\Vistext\Data\allt.mdb;Persist Security Info=False;"/>

' i codebehind
DBConn = new OleDbConnection(ConfigurationSettings.AppSettings
["ConnectionString"]);
```

Det fungerar inte i ASP.net 2, hur gör jag där?
Jag fick ett tips innan, men det var för SQL-server.

Permalänk: https://www.webforum.nu/p/143391

## #2 — ahlen, 2006-03-04T19:07Z

Först och främst, vad är fel och vad får du för felmeddelande?

Permalänk: https://www.webforum.nu/p/1777030

## #3 — saw, 2006-03-04T20:35Z

Jag får detta fel:

```
+	$exception	{"Unrecognized attribute 'value'. 
Note that attribute names are case-sensitive. (C:\\Inetpub\\wwwroot\\ASP_Net-Test\\
Saw-Asp.net\\web.config line 13)"}	System.Exception 
{System.Configuration.ConfigurationErrorsException}
```

Permalänk: https://www.webforum.nu/p/1777055

## #4 — Gladh, 2006-03-05T07:52Z

ConfigurationSettings är påväg bort från .NET du skall använda dig av ConfigurationManager istället som ligger i System.Configuration som du måste adda en referense till.

\- M

Permalänk: https://www.webforum.nu/p/1777112

## #5 — saw, 2006-03-05T08:19Z

Problemen är detsamma:

```
Unrecognized attribute 'value'. Note that attribute names are case-sensitive.
(C:\Inetpub\wwwroot\ASP_Net-Test\Saw-Asp.net\web.config line 13)
```

I webconfig:

```
<connectionStrings>    
    <add name="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source= 
C:\Inetpub\wwwroot\ASP_Net-Test\Saw-Asp.net\saw_filer\Data\allt.mdb;Persist Security Info=False;"/>
  </connectionStrings>
```

och sedan hämtar:

```
DBConn = new OleDbConnection(ConfigurationManager.ConnectionStrings
["ConnectionString"].ConnectionString);
```

Jag hittar inget exempel för Access enbart för SQL-server.

Permalänk: https://www.webforum.nu/p/1777116

## #6 — cyprys, 2006-03-05T08:40Z

```
<connectionStrings>    
  <add name="myConnectionString" 
   connectionString="Provider=Microsoft.J..." />
</connectionStrings>
```

Permalänk: https://www.webforum.nu/p/1777118

## #7 — saw, 2006-03-05T08:55Z

Tack för detta.

Permalänk: https://www.webforum.nu/p/1777121

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/143391-connections-problem
