Salut,
je fais creation du connetion string dans le file web.config,
1 2 3 4 5
|
<connectionStrings>
<add name="Northwind" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=Northwind;Integrated
Security=SSPI" />
</connectionStrings> |
j'ai le code dans le file web.config, et j'ai defenit la connection string dans le class du page
private string connectionstring = WebConfigurationManager.ConnectionStrings["Northwind"].ToString();
la page n'ouvre pas il ya un error toujours sur le ligne du <connectionString>
si on fait jouer un peu dans le code dans web.config,
et ecrire
1 2 3 4
| <connectionStrings>
<add name="Northwind" connectionString="Server=(local)\SQLExpress;Integrated Security=True;Database=Northwind;Persist Security Info=True"
providerName="System.Data.SqlClient" />
</connectionStrings> |
l'IE affiche qu'il y un error :
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Sections must only appear once per config file. See the help topic <location> for exceptions
qu'est ce qu'il faut faire ?
Partager