SQL数据导出:ConnectionString属性尚未初始化。 (System.Data) [英] SQL data export: The ConnectionString property has not been initialized. (System.Data)

查看:1514
本文介绍了SQL数据导出:ConnectionString属性尚未初始化。 (System.Data)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的数据库导出为.Net SqlClient数据提供程序格式,但我不断收到此错误消息:



无法完成操作附加信息:ConnectionString属性尚未初始化。 (System.Data)

程序位置:代码:

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)





但我的app配置连接字符串声明为



代码:

 <  配置 >  
< configsections >
< / configsections >
< connectionstrings >
< add name = WindowsApplication2.My.MySettings.ConnectionString >
connectionString =数据源= ARULJUSTIN \ SQLEXPRESS;初始目录= firemaintain;集成安全性=真;池化=假
providerName =System.Data.SqlClient/>
< / add > < / connectionstrings >
< startup >
< supportedruntime 版本 = v4.0 < span class =code-attribute> sku = 。NETFramework,Version = v4.0,Profile = Client / >
< / startup >
< / configuration >

解决方案

在我看来,连接字符串是错误的。要正确设置,请参阅: 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[^]


这篇关于SQL数据导出:ConnectionString属性尚未初始化。 (System.Data)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆