Home All Groups Group Topic Archive Search About

Can't run aspnet_regsql.exe on remote machine

Author
9 Dec 2006 5:32 PM
Amit
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

Author
9 Dec 2006 6:29 PM
Gabriel Lozano-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
Author
9 Dec 2006 7:03 PM
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


Show quote
"Gabriel Lozano-Morán" <ab***@frontbridge.com> wrote in message
news:e9b0f74421ece8c8e9df69929e70@news.microsoft.com...
> 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
>
>
Author
9 Dec 2006 7:04 PM
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


Show quote
"Gabriel Lozano-Morán" <ab***@frontbridge.com> wrote in message
news:e9b0f74421ece8c8e9df69929e70@news.microsoft.com...
> 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
>
>
Author
9 Dec 2006 7:59 PM
Amit
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

Show quote
"Gabriel Lozano-Morán" wrote:

> 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" <ab***@frontbridge.com> wrote in message
> news:e9b0f74421ece8c8e9df69929e70@news.microsoft.com...
> > 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
> >
> >
>
>
>

AddThis Social Bookmark Button