且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL数据导出:ConnectionString属性尚未初始化。 (System.Data)

更新时间:2022-10-25 22:53:21

在我看来,连接字符串是错误的。要正确设置,请参阅: ms sql server 2008 / 的连接字符串[ ^ ]



更多信息,请参阅:

如何:从Web读取连接字符串。配置文件 [ ^ ]

连接字符串和配置文件 [ ^ 一>

I am trying to export my database as .Net SqlClient Data Provider format but I keep getting this error message:

The operation could not be completed ADDITIONAL INFORMATION: The ConnectionString property has not been initialized. (System.Data)

Program Location: code:

       at System.Data.SqlClient.SqlConnection.PermissionDemand()
       at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Dts.DtsWizard.DTSWizard.GetOpenedConnection(WizardInputs wizardInputs, String connEntryName)
       at Microsoft.SqlServer.Dts.DtsWizard.Step2.OnLeavePage(LeavePageEventArgs e)



but my app config has the connection string declared as

code:

<configuration>
    <configsections>
    </configsections>
    <connectionstrings>
        <add name="WindowsApplication2.My.MySettings.ConnectionString">
            connectionString="Data Source=ARULJUSTIN\SQLEXPRESS;Initial Catalog=firemaintain;Integrated Security=True;Pooling=False"
            providerName="System.Data.SqlClient" />
    </add></connectionstrings>
    <startup>
        <supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
    </startup>
</configuration>

In my opinion, the connection string is wrong. To set it properly, please see: connectionstring for ms sql server 2008/[^]

For further information, please see:
How to: Read Connection Strings from the Web.config File[^]
Connection Strings and Configuration Files[^]