Can't run aspnet_regsql.exe on remote machine

G

Guest

I cannot run aspnet_regsql.exe on a remote machine. The remote machine is
running MSSQL 2000 and is behind my local network. Its basically a sandbox
machine.

I specify my remote machine's name (Nightcrawler), SQL Server user name and
password at the "Select the Server and Database" screen.

I get the following error.

System.Web.HttpException: Unable to connect to SQL Server database. --->
System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not responding.

I also have tried entering the IP address of the remote machine with no luck.

Please help!!

Thanks
 
?

=?iso-8859-1?Q?Gabriel=20Lozano-Mor=e1n?=

Hello Amit,

Create a new .NET 2.0 console application on your client machine and copy
paste the following code. In this code I assume that you use a trusted connection,
you can try with SQL Server authentication by removing the trusted_connection
from the connection string and specifying the UID and PWD:

using System;
using System.Data.SqlClient;

namespace ConsoleApplication1
{
internal class Program
{
private static void Main(string[] args)
{
string connectionString = "server=Nightcrawler;Trusted_Connection=true;UID=userid;PWD=password;";
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand("SELECT name FROM sysdatabases
ORDER BY name", connection);
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader.GetString(0));
}
}
}
Console.ReadKey();
}
}
}

If you run this on the same machine from where you are trying to run ASPNET_REGSQL.exe
it should throw the same exception. As far as I know you can't change the
command timeout that for ASPNET_REGSQL.exe, the command timeout is defaulted
to 30 secs.

Gabriel Lozano-Morán
The .NET Aficionado
http://www.pointerx.net
 
G

Gabriel Lozano-Morán

As replied on your other post enter the following text as your server name:

Nightcrawler;Connect Timeout=180

This will increase the connection timeout to 3 minutes but it might be
interesting investigating why connecting to the server takes longer than 15
secs. You could ask for help on this matter on one of the SQL Server
newsgroups.

Gabriel Lozano-Morán
The .NET Aficionado
http://www.pointerx.net
 
G

Gabriel Lozano-Morán

As replied on your other post enter the following text as your server name:

Nightcrawler;Connect Timeout=180

This will increase the connection timeout to 3 minutes but it might be
interesting investigating why connecting to the server takes longer than 15
secs. You could ask for help on this matter on one of the SQL Server
newsgroups.

Gabriel Lozano-Morán
The .NET Aficionado
http://www.pointerx.net
 
G

Guest

Dude, thank you! I didn't even realize injecting a connect timeout would
work, but it did. I used Nightcrawler;Connect Timeout=180 and it was able to
find all the databases on that server. It took maybe 15-20 seconds....don't
know why, maybe because its a slow machine or its going over wireless.

Much thanks Gabriel! Ahh...relief.

Amit

Gabriel Lozano-Morán said:
As replied on your other post enter the following text as your server name:

Nightcrawler;Connect Timeout=180

This will increase the connection timeout to 3 minutes but it might be
interesting investigating why connecting to the server takes longer than 15
secs. You could ask for help on this matter on one of the SQL Server
newsgroups.

Gabriel Lozano-Morán
The .NET Aficionado
http://www.pointerx.net


Gabriel Lozano-Morán said:
Hello Amit,

Create a new .NET 2.0 console application on your client machine and copy
paste the following code. In this code I assume that you use a trusted
connection, you can try with SQL Server authentication by removing the
trusted_connection from the connection string and specifying the UID and
PWD:

using System;
using System.Data.SqlClient;

namespace ConsoleApplication1
{
internal class Program
{
private static void Main(string[] args)
{
string connectionString =
"server=Nightcrawler;Trusted_Connection=true;UID=userid;PWD=password;";
using (SqlConnection connection = new
SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand("SELECT name FROM
sysdatabases ORDER BY name", connection);
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader.GetString(0));
}
}
}
Console.ReadKey();
}
}
}

If you run this on the same machine from where you are trying to run
ASPNET_REGSQL.exe it should throw the same exception. As far as I know you
can't change the command timeout that for ASPNET_REGSQL.exe, the command
timeout is defaulted to 30 secs.

Gabriel Lozano-Morán
The .NET Aficionado
http://www.pointerx.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top