ASP.NET 2.0 - a newbie question


G

grubas8

Hi everybody!

Is there some experienced ASP.NET 2.0 developer, who could answer some
newbie questions?

I am a complete newbie to ASP.NET 2.0 and Web programming, trying to
take my first steps. For this, I have bought a couple of books
("ASP.NET 2.0 for Dummies", "ASP.NET 2.0 Everyday Appsf for Dummies"
and downloaded some developer software:

- Microsoft Visual Web Developer 2005 Express Edition
- Microsoft Visual C# 2005 Express Edition

I have build and run some "Hello World"-type applications from the
first book, they seem to work OK. So far, I am doing it all on my PC,
not uploading anything to a remote website and using the build-in Web
server that comes bundled Microsoft VWDE.

Now for the problem.

I try to build the first app described in "ASP.NET 2.0 Everyday Apps
for Dummies" - a simple app for creating and managing user accounts.
It consists of a login page that contains a login control, a "Create
User" wizard and a few mor things. Successfull creation of a user
should lead to a different page. Mostly, it is an app for
demonstrating stuff like the Login control, the CreateUserWizard
control etc.

However, if I try to create a new user, nothing happens for perhaps a
minute and then I get a debug screen. It begins like this:

_____________________________
"Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x274c): A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +200
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +60
System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception) +579

[WebException: Unable to connect to the remote server]

____________________

As I understand, the user accounts in ASP.NET 2.0 are handled by an
SQL database. Am I right about that? Do I need to download the
Microsoft SQL Server? I don't think it comes bundled with either the
Microsoft Visual Web Developer or Microsoft Visual C#. Am I right
about that? Do I guess right about the reason for failure? And the SQL
server - do I need to download it? Is there a way to check if I
already have it installed?

Thanks in advance for all advice.

Grubas
 
Ad

Advertisements

P

Peter Bromberg [C# MVP]

Not to sound like a broken MP3 again, but have you tried the ASP.NET
QUICKSTARTS? It details all these basic operations. It installs with the .NET
Framework SDK, or you can visit the online version at the asp.net web site.

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


Hi everybody!

Is there some experienced ASP.NET 2.0 developer, who could answer some
newbie questions?

I am a complete newbie to ASP.NET 2.0 and Web programming, trying to
take my first steps. For this, I have bought a couple of books
("ASP.NET 2.0 for Dummies", "ASP.NET 2.0 Everyday Appsf for Dummies"
and downloaded some developer software:

- Microsoft Visual Web Developer 2005 Express Edition
- Microsoft Visual C# 2005 Express Edition

I have build and run some "Hello World"-type applications from the
first book, they seem to work OK. So far, I am doing it all on my PC,
not uploading anything to a remote website and using the build-in Web
server that comes bundled Microsoft VWDE.

Now for the problem.

I try to build the first app described in "ASP.NET 2.0 Everyday Apps
for Dummies" - a simple app for creating and managing user accounts.
It consists of a login page that contains a login control, a "Create
User" wizard and a few mor things. Successfull creation of a user
should lead to a different page. Mostly, it is an app for
demonstrating stuff like the Login control, the CreateUserWizard
control etc.

However, if I try to create a new user, nothing happens for perhaps a
minute and then I get a debug screen. It begins like this:

_____________________________
"Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x274c): A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +200
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +60
System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception) +579

[WebException: Unable to connect to the remote server]

____________________

As I understand, the user accounts in ASP.NET 2.0 are handled by an
SQL database. Am I right about that? Do I need to download the
Microsoft SQL Server? I don't think it comes bundled with either the
Microsoft Visual Web Developer or Microsoft Visual C#. Am I right
about that? Do I guess right about the reason for failure? And the SQL
server - do I need to download it? Is there a way to check if I
already have it installed?

Thanks in advance for all advice.

Grubas
 
P

Phil H

Hi everybody!

Is there some experienced ASP.NET 2.0 developer, who could answer some
newbie questions?

I am a complete newbie to  ASP.NET 2.0 and Web programming, trying to
take my first steps. For this, I have bought a couple of books
("ASP.NET 2.0 for Dummies", "ASP.NET 2.0 Everyday Appsf for Dummies"
and downloaded some developer software:

- Microsoft Visual Web Developer 2005 Express Edition
- Microsoft Visual C# 2005 Express Edition

I have build and run some "Hello World"-type applications from the
first book, they seem to work OK. So far, I am doing it all on my PC,
not uploading anything to a remote website and using the build-in Web
server that comes bundled Microsoft VWDE.

Now for the problem.

I try to build the first app described in "ASP.NET 2.0 Everyday Apps
for Dummies" - a simple app for creating and managing user accounts.
It consists of a login page that contains a login control, a "Create
User" wizard and a few mor things. Successfull creation of a user
should lead to a different page. Mostly, it is an app for
demonstrating stuff like the Login control, the CreateUserWizard
control etc.

However, if I try to create a new user, nothing happens for perhaps a
minute and then I get a debug screen. It begins like this:

_____________________________
"Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x274c): A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +200
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +60
   System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception) +579

[WebException: Unable to connect to the remote server]

____________________

As I understand, the user accounts in ASP.NET 2.0 are handled by an
SQL database. Am I right about that? Do I need to download the
Microsoft SQL Server? I don't think it comes bundled with either the
Microsoft Visual Web Developer or  Microsoft Visual C#. Am I right
about that? Do I guess right about the reason for failure? And the SQL
server - do I need to download it? Is there a way to check if I
already have it installed?

Thanks in advance for all advice.

Grubas

Hi

The answer to both questions is yes. You can download SQL2005 Express,
no license is required to use it, and it will handle Membership and
Roles using the default ASP.NET provider. You should find the database
file in the App_Data directory of the web site probably named
ASPNETDB.MDF A word of warning though. It uses a peculier mode of
operation known as "user instances". Normally database files are
permantly "attached" to a database defined in SQL server but in this
mode an instance of the database is created on the fly using the given
file. In my experience it's flaky and I never use it. This is only the
default configuration it can be overriden by settings in the
WEB.CONFIG file.

To find out how it is currently configured look in the WEB.CONFIG file
for the section "Connection strings" You'll probably see one named
"LocalSqlServer" The actual value will contain the word "Userinstance
= true" and it will assume the source is on the App_Data directory
(using some peculiar but recognisable alias for the path).

Without knowing what set-up instructions are in the book it's
difficult to diagnose the problem fully but it sounds as though SQL
server is missing.
 
Ad

Advertisements

G

grubas8

Hi everybody!
Is there some experienced ASP.NET 2.0 developer, who could answer some
newbie questions?
I am a complete newbie to  ASP.NET 2.0 and Web programming, trying to
take my first steps. For this, I have bought a couple of books
("ASP.NET 2.0 for Dummies", "ASP.NET 2.0 Everyday Appsf for Dummies"
and downloaded some developer software:
- Microsoft Visual Web Developer 2005 Express Edition
- Microsoft Visual C# 2005 Express Edition
I have build and run some "Hello World"-type applications from the
first book, they seem to work OK. So far, I am doing it all on my PC,
not uploading anything to a remote website and using the build-in Web
server that comes bundled Microsoft VWDE.
Now for the problem.
I try to build the first app described in "ASP.NET 2.0 Everyday Apps
for Dummies" - a simple app for creating and managing user accounts.
It consists of a login page that contains a login control, a "Create
User" wizard and a few mor things. Successfull creation of a user
should lead to a different page. Mostly, it is an app for
demonstrating stuff like the Login control, the CreateUserWizard
control etc.
However, if I try to create a new user, nothing happens for perhaps a
minute and then I get a debug screen. It begins like this:
_____________________________
"Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x274c): A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +200
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +60
   System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception) +579
[WebException: Unable to connect to the remote server]
____________________

As I understand, the user accounts in ASP.NET 2.0 are handled by an
SQL database. Am I right about that? Do I need to download the
Microsoft SQL Server? I don't think it comes bundled with either the
Microsoft Visual Web Developer or  Microsoft Visual C#. Am I right
about that? Do I guess right about the reason for failure? And the SQL
server - do I need to download it? Is there a way to check if I
already have it installed?
Thanks in advance for all advice.

Hi

The answer to both questions is yes. You can download SQL2005 Express,
no license is required to use it, and it will handle Membership and
Roles using the default ASP.NET provider. You should find the database
file in the App_Data directory of the web site probably named
ASPNETDB.MDF A word of warning though. It uses a peculier mode of
operation known as "user instances". Normally database files are
permantly "attached" to a database defined in SQL server but in this
mode an instance of the database is created on the fly using the given
file. In my experience it's flaky and I never use it. This is only the
default configuration it can be overriden by settings in the
WEB.CONFIG file.

To find out how it is currently configured look in the WEB.CONFIG file
for the section "Connection strings" You'll probably see one named
"LocalSqlServer" The actual value will contain the word "Userinstance
= true" and it will assume the source is on the App_Data directory
(using some peculiar but recognisable alias for the path).

Without knowing what set-up instructions are in the book it's
difficult to diagnose the problem fully but it sounds as though SQL
server is missing

Hi again!

I have tried to run the same app on my work computer, on a slightly
different configuration (there I have a Visual Studio 2005).
Proffessionally, I do not work with Web design, so there is nobody
around me to ask.

The results are almost the same, however on this computer I get the
following debug screen:

________________________

"Server Error in '/LoginCS' Application.
No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x274d): No connection could be made because the
target machine actively refused it]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +200
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +60
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout,
Exception& exception) +579"
____________________________________________________________

I have checked and it seems that I DO have the MS SQL server installed
on this machine. I have tried to download it and instal it, and the
installation program found that the MS SQL Server is already present
on this machine.

When I look under "Start"/"Programs", i find en entry named "Microsoft
SQL Server 2005". When I click on it, another entry shows, called
"Configuration Tools". When I click on this one, it shows following
entries:

- SQL Server Configuration Manager
- SQL Server Error and Usage Reporting
- SQL Server Surface Area Configuration

I don't have any problem creating and running simple ASP.NET apps,
either at home or (after hours) at work (as long asI don't try to use
the Login control). Thus, I obviously can reach and use the ASP.NET
dev server.

Do I need to configure the SQL server in some special way? Is there
any info I could provide in otder to pinpoint the problem (such as,
for instance, the (extremely small) source code I've copied from the
"for dummies" book and am trying to run?

Sincerely grateful for any advice,

Grubas,

an old programmer but completely green about Windows/Web Apps/ASP.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