我需要数据方面的帮助... [英] I need a litle help with the data...

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

问题描述

大家好,

我现在找到此站点,并且看到每个人都在问他们的问题.

所以我会回答我的问题.
我与合作伙伴一起使用C#2008,但是正在发生一些奇怪的事情.
他们创建了一个数据库,在他们的计算机上一切正常,当他们向我发送项目以使其成为我的一部分时,我尝试连接到现有数据库,这是给我的错误:

http://imageshack.us/photo/my-images/831/gre6ka.jpg/ [ ^ ]

我相信您的帮助人员之前的10倍,也许力量与您同在:
检查事项:
1.确保您的数据库引擎已配置为接受远程连接
•开始>所有程序> SQL Server 2005>配置工具> SQL Server外围应用配置器
•单击服务和连接的外围应用配置"
•选择有问题的实例>数据库引擎远程连接
•启用本地和远程连接
•重新启动实例
2.检查SQL Server服务帐户
•如果您没有将域帐户用作服务帐户(例如,如果您正在使用NETWORK SERVICE),则可能需要先切换此帐户,然后再继续进行操作
3.如果使用的是命名SQL Server实例,请确保在ASweb P.NET应用程序的连接字符串中使用该实例名称. •通常,指定数据库服务器所需的格式为machinename \ instancename
•还检查您的连接字符串
< connectionStrings>
<添加名称="SampleConnectionString" connectionString =数据源=机器名称\实例名称;初始目录= AdventureWorks;集成安全性= SSPI;最小池大小= 5;最大池大小= 60;连接超时= 30" providerName ="系统. Data.SqlClient"/>
</connectionStrings>
4.您可能需要在防火墙上为正在使用的SQL Server实例和端口创建一个例外
•开始>运行> Firewall.cpl
•单击例外"选项卡
•添加sqlservr.exe(通常位于C:\ Program Files(x86)\ Microsoft SQL Server \ MSSQL.x \ MSSQL \ Binn中)和端口(默认为1433)
•还检查您的连接字符串
5.如果使用的是命名的SQL Server实例,请确保在连接字符串中使用该实例名称.
6.检查SQLBrowser;检查它是否正在运行.您可能还需要在防火墙中为SQLBrowser创建一个例外.
7.检查您是否具有与SQL Server的连接.请注意您正在使用的连接方式:机器名称,域名或IP地址?检查连通性时使用此功能.例如,如果您使用的是myserver
•开始>运行> cmd
•netstat -ano | findstr 1433
•telnet myserver 1433
•ping -a myserver
检查正在返回哪些端口的IP地址.
另类:
如果仍然无法建立任何连接,则可能要在服务器上创建一个SQL帐户,在有问题的数据库上创建一个相应的SQL用户,然后在Web应用程序中使用此用户名/密码组合即可.


很抱歉,不是连接问题,实际上不是编码问题...只要您的连接字符串正确并且SQL Server实际上可用并且您有权连接,就没有更多了代码方面的工作.


Hi to everyone,

I find this site now and I see that everyone is asking their questions.

So I will do it with my question.
I work with my partners on C# 2008, but something strange is happening.
They create a database, everything is fine on their machines, and when they send me the project to make my part of it, and I try to connect to the existing database here is what error it gives me:

http://imageshack.us/photo/my-images/831/gre6ka.jpg/[^]

10x before the help guys I believe in you, may the force be with you :D

解决方案

In google in a link I found this:

Things to check:
1. Make sure your database engine is configured to accept remote connections
• Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
• Click on Surface Area Configuration for Services and Connections
• Select the instance that is having a problem > Database Engine > Remote Connections
• Enable local and remote connections
• Restart instance
2. Check the SQL Server service account
• If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding
3. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application
• Usually the format needed to specify the database server is machinename\instancename
• Check your connection string as well
<connectionStrings>
<add name="SampleConnectionString" connectionString="Data Source=machinename\instancename;Initial Catalog=AdventureWorks;Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect Timeout=30″ providerName="System.Data.SqlClient"/>
</connectionStrings>
4.You may need to create an exception on the firewall for the SQL Server instance and port you are using
• Start > Run > Firewall.cpl
• Click on exceptions tab
• Add the sqlservr.exe (typically located in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Binn), and port (default is 1433)
• Check your connection string as well
5. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings
6. Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall for SQLBrowser.
7. Check that you have connectivity to the SQL Server. Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
• Start > Run > cmd
•netstat -ano| findstr 1433
•telnet myserver 1433
•ping -a myserver
Check what ports are IP addresses are being returned.
Alternative:
If you still can’t get any connection, you may want to create a SQL account on the server, a corresponding SQL user on the database in question, and just use this username/password combo in your web application.


Sorry, not really a coding problem as much as connectivity issue... as long as your connection string is correct and the SQL Server is in fact available and you are authorized to connect to it, there is nothing more code-wise that need be done.


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

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