Home > Database > Mysql Tutorial > body text

winform 用access数据库怎么调用app.config中的数据连接?

WBOY
Release: 2016-06-07 15:38:13
Original
1490 people have browsed it

在web.config中使用SQL2005是这样使用的: web.config: connectionStrings add name="win2009ConnectionString" connectionString="Data Source=COMPUTER;Initial Catalog=win2010;Integrated Security=True" providerName="System.Data.SqlClient"/ /conne

在web.config中使用SQL2005是这样使用的:

web.config:

 
   
 

调用

public SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["win2009ConnectionString"].ConnectionString);

 

在winform项目中:

app.config:



 
 

 
          connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\hj009_consume.mdb"
      providerName="System.Data.OleDb" />
 

 

求教:怎么调用winform 中的ACCess的连接,先谢谢!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!