数据库数据集中的问题.... [英] Problem in database dataset....

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

问题描述

目前我一直在大学项目上工作,我在sql server 2008中创建我的数据库。在C#中我通过数据集(虚拟数据库)调用数据库,当我尝试在另一台PC上运行我的项目时,它会给出错误数据库连接。虽然我已将数据库的备份副本粘贴到另一台PC ...解决方案是什么。我不明白..提前谢谢。

currently i been working on University project, i make my database in sql server 2008. in C# side i call the database through dataset (virtual database), when ever i try to run my project on another PC it's give error that no database connected. while i have paste the backup copy of database to the other PC...what is the solution. i dont understand.. thanks in advance.

推荐答案

Plz检查你的连接字符串。

连接到SQL服务器实例的连接字符串需要更改 - 即SQL服务器名称和数据库名称与系统服务器名称和dbName相符。
Plz Check your connection string.
The connection string to connect to the SQL server instance needs to be changed - i.e. the SQL server name, and database Name metch with Systems Server Name and dbName.


我想到两个主要可能性:

1) (易于修复)需要更改连接到SQL服务器实例的连接字符串以适应新环境 - 即,此计算机上可用的SQL服务器具有不同的名称或访问详细信息。

2)(相当难)新PC无法访问任何SQL服务器实例。这意味着要么在PC可以访问它的地方安装SQL服务器,要么将软件改为使用单个用户数据库系统。
Two major possibilities spring to mind:
1) (Simple to fix) The connection string to connect to the SQL server instance needs to be changed to fit the new environment - i.e. the SQL server available from this machine has a different name, or access details.
2) (Rather harder) The new PC does not have access to any SQL server instance. This means either installing SQL server somewhere where the PC can access it, or changing you software to use a single user database system instead.


你不能复制SQL Server,你需要将它安装在另一台机器上并相应地设置连接字符串。

如果您使用过SQL CE,则需要以一种或另一种方式部署所有SQL CE引擎。

请查看以下链接:

http://msdn.microsoft.com/en-us/library/vstudio/bb546200(v = vs.100).aspx [ ^ ]

< a href =http://msdn.microsoft.com/en-us/library/vstudio/aa983326(v=vs.100).aspx> http://msdn.microsoft.com/en-us/library/ vstudio / aa983326(v = vs.100).aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/bb522540(v = sql.105).aspx [ ^ ]
You can't "copy" SQL Server, you need to have it installed on the other machine and to have your connection string set up accordingly.
If you have used SQL CE, than you need to deploy all the SQL CE engine in one or the other way.
Please check following links:
http://msdn.microsoft.com/en-us/library/vstudio/bb546200(v=vs.100).aspx[^]
http://msdn.microsoft.com/en-us/library/vstudio/aa983326(v=vs.100).aspx[^]
http://msdn.microsoft.com/en-us/library/bb522540(v=sql.105).aspx[^]


这篇关于数据库数据集中的问题....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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