Home >Database >Mysql Tutorial >winform 用access数据库怎么调用app.config中的数据连接?

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

WBOY
WBOYOriginal
2016-06-07 15:38:131567browse

在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的连接,先谢谢!

Statement:
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