数据库连接字符串问题
dbclass.cs:private SqlConnection myConnection = null;
// 打开数据库连接
if (myConnection == null)
{
myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["TestProviderConnectionString"].ConnectionString);
}
另外在XML里设置
<connectionStrings>
<add name="TestProviderConnectionString" connectionString="Data Source=127.0.0.1;Initial Catalog=runsky;Persist Security Info=True;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
</connectionStrings>
未何在运行窗口的时候,提示错误:未将对像引用设置到对像的实例呢?
我用的是.net2005,数据库是SQL2000.请大家指教,谢谢.