C#数据库程序在其他计算机上不起作用 [英] c# database program does not work in other computer

查看:114
本文介绍了C#数据库程序在其他计算机上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图制作一个简单的程序来存储用户提供的名称和密码....我将sql server 2005用于数据库....项目完成后,我创建了一个安装文件并安装了它在我朋友的电脑上,但在那台电脑上无法使用...
我们如何使用与其他任何计算机兼容的c#程序来创建数据库....如何在程序安装过程中创建数据库...是否可以创建动态连接字符串... confusionsss ...

i tried to make a simple program that store a name and password given by the user....i used sql server 2005 for the database....after the completion of the project i create a setup file and installed it in my friend''s computer but it didn''t work in that computer...
how can we make a database using program in c# that is compatible with any other computer....how can we create a database during the installation of the program...is it possible to make a dynamic connection string...loads of confusionsss...

推荐答案

事情不是那么简单:它取决于许多因素:
1)您使用了什么数据库?如果您使用MySql或MS Sql,则必须将其安装在您的朋友可以从服务器获取的位置.这可能意味着将其安装在他的计算机以及您的程序上.
另外,如果只需要一个用户数据库,则可以改用SqlCE:它不需要安装.NET所需的安装,因此使用起来更加容易.
2)数据库在哪里?这与上面的(1)有关,但是如果是MySql或MsSQL,则必须在安装软件时让您的朋友识别数据库所在的服务器,并可能在teh上将该数据库安装在该服务器上同时.

动态配置字符串很简单,要找出要放入其中的内容是很困难的! :laugh:
It''s not that simple: it depends on a number of factors:
1) What database did you use? If you used MySql or MS Sql, then it has to be installed where your friend can get at the server. This may mean installing it on his computer as well as your program.
Alternatively, if you only need a single user database, then you may get away with using SqlCE instead: it requires no installation other than that needed for .NET and is thus a lot easier to work with.
2) Where is the database? This will be related to (1) above, but if it is MySql or MsSQL then you will have to get your friend to identify the server that the database is on when you install the software, and possibly install the database on that server at teh same time.

Dynamic configuration strings are simple, it''s working out what to put in them that is difficult! :laugh:


说"但没有用"并不能帮助您.描述您的问题,您做了什么,得到什么错误消息……人们可能会为您提供帮助.


我们如何使用与其他任何计算机兼容的c#程序来创建数据库....我们如何在安装程序期间创建数据库...是否可以创建动态连接字符串. "

对于问答活动而言,不确定性太强.阅读规则:"要具体!"


令人困惑的事情……"

确实.
Saying "but it didn''t work" isn''t getting you any help. Describe your problem, what you did, what error-messages you get... and people might be able to help you.


"how can we make a database using program in c# that is compatible with any other computer....how can we create a database during the installation of the program...is it possible to make a dynamic connection string."

Too unspecific for Q&A. Read the rules: "Be specific!"


"loads of confusionsss..."

Indeed.


在SQL Server启动并运行后,您可以在新的SQL Server上导入工作数据库的备份.

或者,您可以使用SQL语句创建新数据库 [ [
When you have the SQL server up and running, you can import a backup of the working database on the new SQL server.

Alternative you use SQL statements to create new database[^] and tables[^] inside database.


这篇关于C#数据库程序在其他计算机上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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