SqlDataSource的ConnectionString与Provider

web.config里:(未使用connectionStrings节点)

<appSettings>
<add key="ConnectionString" value="未写出provider=blabla."/>
</appSettings>

 

aspx里:

ProviderName="System.Data.OleDb" 

 

aspx.cs里:

StringBuilder sb = new StringBuilder(Application["DSN"].ToString());
sb.Append(";Provider=SQLOLEDB");
SqlDataSource_abc.ConnectionString = sb.ToString();

 

阅读:http://technet.microsoft.com/zh-tw/library/bb677342(v=sql.105).aspx

posted on 2012-08-29 13:49  caigen  阅读(576)  评论(0编辑  收藏  举报