我无法从安装文件中备份数据库 [英] I Can't take backup of database from my setup file

查看:64
本文介绍了我无法从安装文件中备份数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个项目,并将该安装程序安装在另一台计算机上,然后我无法备份数据库

C#中的Windows应用程序
visualstudio 2008

有关调用
的详细信息,请参见此消息的末尾. 即时(JIT)调试,而不是此对话框.

**************异常文本**************
System.Data.SqlClient.SqlException:无法在sysdatabases中找到数据库"C:\ Users \ Ravu \ Desktop \ Bill \ Bill \ bin \ Debug \ New.mdf"的条目.找不到使用该名称的条目.确保正确输入名称.
备份数据库异常终止.
在System.Data.SqlClient.SqlConnection.OnError(SqlException异常,布尔值breakConnection)
在System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,布尔值breakConnection)
在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
在System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)
在System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,Boolean async)
在System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult结果,字符串methodName,布尔sendToPipe)
在System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
在Bill.MDIParent1.backUpToolStripMenuItem_Click(对象发件人,EventArgs e)中,位于C:\ Users \ Ravu \ Desktop \ Bill \ Bill \ MDIParent1.cs:line 299
在System.Windows.Forms.ToolStripItem.RaiseEvent(对象键,EventArgs e)处
在System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
在System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)中
在System.Windows.Forms.ToolStripItem.FireEventInteractive(满足EventArgs e,ToolStripItemEventType)的情况下
在System.Windows.Forms.ToolStripItem.FireEvent(满足EventArgs e,ToolStripItemEventType)的情况下
在System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
在System.Windows.Forms.Control.WmMouseUp处(消息和m,MouseButtons按钮,Int32单击)
在System.Windows.Forms.Control.WndProc(Message& m)中
在System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在System.Windows.Forms.ToolStrip.WndProc(Message& m)
在System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)中
在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)


**************装配体**************
mscorlib
程序集版本:2.0.0.0
Win32版本:2.0.50727.4971(win7RTMGDR.050727-4900)
代码库:file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
比尔
程序集版本:1.0.0.0
Win32版本:1.0.0.0
代码库:file:///C:/Users/god/AppData/Roaming/Default%20Company%20Name/Setup1/Bill.exe
----------------------------------------
System.Windows.Forms
程序集版本:2.0.0.0
Win32版本:2.0.50727.4977(win7RTMGDR.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
系统
程序集版本:2.0.0.0
Win32版本:2.0.50727.4971(win7RTMGDR.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
程序集版本:2.0.0.0
Win32版本:2.0.50727.4980(win7RTMGDR.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
程序集版本:2.0.0.0
Win32版本:2.0.50727.4927(NetFXspW7.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
程序集版本:2.0.0.0
Win32版本:2.0.50727.4927(NetFXspW7.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
程序集版本:2.0.0.0
Win32版本:2.0.50727.4927(NetFXspW7.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
程序集版本:2.0.0.0
Win32版本:2.0.50727.4927(NetFXspW7.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
程序集版本:2.0.0.0
Win32版本:2.0.50727.4927(NetFXspW7.050727-4900)
代码库:file:///C:/Windows/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------

************** JIT调试**************
要启用即时(JIT)调试,为此的.config文件
应用程序或计算机(machine.config)必须具有
在system.windows.forms部分中设置的jitDebugging值.
该应用程序还必须使用调试进行编译
已启用.

例如:

< configuration>
< system.windows.forms jitdebugging ="true">


启用JIT调试后,任何未处理的异常
将被发送到计算机上注册的JIT调试器
而不是由此对话框处理. [ ] [ ]

I created a project and i installed that setup on another computer,then i can''t take backup of database

windows application in c#
visualstudio 2008

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.SqlClient.SqlException: Could not locate entry in sysdatabases for database ''C:\Users\Ravu\Desktop\Bill\Bill\bin\Debug\New.mdf''. No entry found with that name. Make sure that the name is entered correctly.
BACKUP DATABASE is terminating abnormally.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Bill.MDIParent1.backUpToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\Ravu\Desktop\Bill\Bill\MDIParent1.cs:line 299
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4971 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Bill
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/god/AppData/Roaming/Default%20Company%20Name/Setup1/Bill.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4977 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4971 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4980 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitdebugging="true">


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.[][]

推荐答案

检查数据库路径您已在其他计算机上安装的计算机.
和DB在已安装的计算机上的连接字符串中.
check the path of database that u have installed on other computer.
And DB in connectionstring on installed computer.


这篇关于我无法从安装文件中备份数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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