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