An unhandled exception of type 'System.StackOverflowException' occurred in GUI_Login.DLL
<p>I am changing a console app login over to a web based application and recieve the following error about an Unhandled exception.</p>

<p>In the console app I have the following line of code which resides in the StoredProcDemo class:</p>

<pre><code> StoredProcDemo spd = new StoredProcDemo();
</code></pre>

<p>In the Web Application I have:</p>

<pre><code>Login spd = new Login(); 
</code></pre>

<p>I am not sure what to change it over to. Could someone shed some insight thanks and maybe why? Thanks so much.</p>

<p>Here is the full code if needed.</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Data.SqlTypes;

namespace GUI_Login
{
    public partial class Login : System.Web.UI.Page
    {
            SqlConnection conn = null;
            SqlParameter parmReturnValue;

            Login spd = new Login();

        protected void Page_Load(object sender, EventArgs e)
        {   
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            RunStoredProcParams();
        }

        public void RunStoredProcParams()
        {
            //run simple stored procure
            spd.RunStoredProcParams();

            int Result;
            Result = -1;

            conn = conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=c:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\UserDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True; Integrated Security=SSPI");
            conn.Open();

            try
            {
                //create and open a connection object
                conn = conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=c:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\UserDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True; Integrated Security=SSPI");
                conn.Open();

                //Create the command object indentifying the stored procedure
                SqlCommand cmd = new SqlCommand("PassParamUserID", conn);

                //set the command object so it knows to execute a stored procedure
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@FirstName", txtUserName.Text));
                parmReturnValue = cmd.Parameters.AddWithValue("@UserId", SqlDbType.Int);
                parmReturnValue.Direction = ParameterDirection.ReturnValue;

                cmd.ExecuteNonQuery();
                Result = Convert.ToInt32(cmd.Parameters["@UserId"].Value);
                conn.Close();

                // lblResult.Text = Result;
                if (Result &gt; 0)
                {
                    lblResult.Text = ("User does exist in database");
                }
                else if (Result &lt; 0)
                {
                    lblResult.Text = ("Denied, try another user name");
                }
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }

        }
</code></pre>
