Inquiridor
SQL 2005 Enterprise

Pergunta
-
Todas as Respostas
-
-
-
-
-
-
-
-
Menssagem do erro:
TITLE: Connect to Server
------------------------------
Cannot connect to APOLO.
------------------------------
ADDITIONAL INFORMATION:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------ -
-
-
-
Marcelo, tentei e mesmo assim não resolveu;
Fiz um teste:
Fiz um pequeno programa para tentar conectar no sql, bem simples usando apenas o SqlConnection
O erro é o seguinte:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
O código...
private void addMsg(string msg)
{
if (lbxMenssagens.Text.Trim() == String.Empty)
lbxMenssagens.Text = msg;
else
lbxMenssagens.Text = lbxMenssagens.Text + Environment.NewLine + msg;
}
private void btnConectar_Click(object sender, EventArgs e)
{
string strConnection;
string nomInstancia = cboInstancia.Text;
string User = txtUser.Text;
string Password = txtPass.Text;
string nomCatalog = txtCatalog.Text;
lbxMenssagens.Text = String.Empty;
addMsg("Iniciando...");
lbxMenssagens.Refresh();
strConnection = "Data Source = " + nomInstancia + ";";
strConnection += "Initial Catalog = " + nomCatalog + ";";
strConnection += "User Id = " + User + ";";
strConnection += "Password = " + Password + ";";
SqlConnection sqlCon = new SqlConnection();
try
{
addMsg("Conectando...");
lbxMenssagens.Refresh();
sqlCon.ConnectionString = strConnection;
sqlCon.Open();
addMsg("Conexão OK!!");
lbxMenssagens.Refresh();
}
catch (Exception err)
{
addMsg("Erro:");
addMsg(err.Message);
lbxMenssagens.Refresh();
}
finally
{
sqlCon.Close();
}
Console.ReadLine();
} -
O erro acima é quando tento conectar no servidor ( Win 2003 server)
Uma outra instância do sql está instalado em uma outra maquina ( WinXP SP2 )
Usando o programa acima ele mostra o seguinte erro:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) -
-