Click here to Skip to main content
15,896,063 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How prevent duplicate record run update statement else Insert Statement Pin
Michael Bookatz28-Oct-08 2:17
Michael Bookatz28-Oct-08 2:17 
QuestionJavascript Issue -Not working in Firefox Pin
Ridge Howison27-Oct-08 11:21
Ridge Howison27-Oct-08 11:21 
AnswerRe: Javascript Issue -Not working in Firefox Pin
Guffa27-Oct-08 16:12
Guffa27-Oct-08 16:12 
QuestionFormat the XML file With Asp.net Csharp Pin
zjaffary27-Oct-08 10:36
zjaffary27-Oct-08 10:36 
AnswerCross post and Repost Pin
led mike27-Oct-08 11:02
led mike27-Oct-08 11:02 
QuestionEdit mode in GridView changes column width Pin
Pravinc198427-Oct-08 8:52
Pravinc198427-Oct-08 8:52 
AnswerRe: Edit mode in GridView changes column width Pin
meeram39527-Oct-08 21:17
meeram39527-Oct-08 21:17 
QuestionTimeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Pin
AndersgRex27-Oct-08 6:40
AndersgRex27-Oct-08 6:40 
Hi I've got this message and I don't know how to solve the problem.
Error message first, Source code and then the example of SQL connection.

Error message:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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:
[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +1184409

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105

System.Data.SqlClient.SqlConnection.Open() +111

Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +196

Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +222

FG2007.objUser.LoginUser(String UserName, String Password) +108

FG2007.Login.Btn_Login_Click(Object sender, ImageClickEventArgs e) +510

System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105

System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115

System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Source code:
public partial class Login : System.Web.UI.Page
    {
        
        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btn_Login.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_Login_Click);
            this.btn_PukReg.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_PukReg_Click);

        }
        #endregion

        protected void Page_Load(object sender, System.EventArgs e)
        {
            UserName.Attributes.Add("onkeypress", "return handleEnter('" + btn_Login.ClientID + "', event)");
            txtPuk.Attributes.Add("onkeypress", "return handleEnter('" + btn_PukReg.ClientID + "', event)");

            if (!IsPostBack)
            {
                if (Request.Cookies["USERNAME"] != null)
                    UserName.Text = Request.Cookies["USERNAME"].Value;

                if (Request.Cookies["PASSWORD"] != null)
                    Password.Attributes.Add("value", Request.Cookies["PASSWORD"].Value);

                if (Request.Cookies["USERNAME"] != null && Request.Cookies["PASSWORD"] != null)
                    RememberMe.Checked = true;
            }

            
            
            emailp = Request.QueryString["emailp"];
            if (emailp != null)
            {
                txtPuk.Text = emailp;
            }

            if (!IsPostBack)
            {
                string mode = Request.QueryString["mode"];
                switch (mode)
                {
                    case "pukbad":
                        lblPukMsg.Text = BADPUK;
                        lblPukMsg.ForeColor = Color.Red;
                        Helpers.SetFocus(this, txtPuk);
                        break;
                    case "pukformsaved":
                        lblPukMsg.Text = PUKFORMSAVED;
                        lblPukMsg.ForeColor = Color.Green;
                        Helpers.SetFocus(this, txtPuk);
                        break;
                    default:
                        lblPukMsg.Text = string.Empty;
                        Helpers.SetFocus(this, txtPuk);
                        break;
                }
            }
            else
                if (UserName.Text.Length > 0)
                {
                    Helpers.SetFocus(this, UserName);
                    
                }
                else
                    Helpers.SetFocus(this, txtPuk);

            if (emailp != null)
            {
                lblPukMsg.Text = string.Empty;
                lblPukMsg.ForeColor = Color.Red;


                txtPuk.Text = txtPuk.Text.Trim().ToUpper();
                switch (txtPuk.Text.Length)
                {
                    case 10:
                        switch (objContract.CheckPuk(txtPuk.Text))
                        {
                            case 0:
                            case 1:
                                break;
                            case -1:
                                lblPukMsg.Text = BADPUK;
                                break;
                            case 2:
                                lblPukMsg.Text = PUKUSED;
                                break;
                        }
                        break;
                    case 12:
                        Guid ContractID = Guid.Empty;
                        Guid GroupID = Guid.Empty;
                        Guid FormID = Guid.Empty;


                        if (objGroup.CheckPuk(txtPuk.Text, out ContractID, out GroupID, out FormID) >= 0)
                        {
                            //objUser.Current.uType = objUser.UserType.Puk;
                            Helpers.SetCurrentContract(ContractID);
                            Helpers.SetCurrentGroup(GroupID);
                            Helpers.CheckCurrentGroup();

                            if (FormID != Guid.Empty)
                            {
                                lblPukMsg.Text = PUKUSED;
                                
                            }
                            else
                            {

                                if (objContract.Current.AspektMode <= 0 && objContract.Current.ShowReports)
                                {
                                    lblPukMsg.Text = CONTRACT_FINALIZED;
                                }
                                else
                                {
                                                                    }
                            }
                        }
                        else
                            lblPukMsg.Text = BADPUK;
                        break;
                    default:
                        lblPukMsg.Text = BADPUK;
                        break;
                }
            }


        }

        private void Btn_Login_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            if (RememberMe.Checked == true)
            {
                Response.Cookies["USERNAME"].Value = UserName.Text;
                Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(30);
                Response.Cookies["PASSWORD"].Value = Password.Text;
                Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(30);

            }
            else
            {
                Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(-30);
                Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(-30);
            }



            objUser user = objUser.LoginUser(this.UserName.Text, this.Password.Text);
            if (user != null)
            {
                Session["CurrentUser"] = user;

                if (user.uType != objUser.UserType.Free)
                {
                    Helpers.CheckCurrentContract();
                    Helpers.CheckCurrentGroup();
                }

                switch (user.uType)
                {
                    case objUser.UserType.Super:
                    case objUser.UserType.Admin:
                    case objUser.UserType.Ledare:
                        Response.Redirect("Contracts.aspx", true);
                        break;

                    case objUser.UserType.Medlem:
                        Response.Redirect("Puks.aspx", true);
                        break;

                    case objUser.UserType.Free:
                        Response.Redirect("Support.aspx", true);
                        break;

                    case objUser.UserType.Viewer:
                        Response.Redirect("Reports.aspx", true);
                        break;

                }
            }
            else
            {
                this.Lbl_Msg.ForeColor = Color.Red;
                this.Lbl_Msg.Text = "<br>Fel användarnamn <br>eller lösenord.<br><br>";
            }
        }

Using these kind of SQL-connections:
public static DataSet ListUsers()
    {
        return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
    }

AnswerRe: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Pin
Rutvik Dave27-Oct-08 6:53
professionalRutvik Dave27-Oct-08 6:53 
AnswerRe: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Pin
AndersgRex27-Oct-08 8:31
AndersgRex27-Oct-08 8:31 
GeneralRe: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Pin
Ashfield27-Oct-08 9:48
Ashfield27-Oct-08 9:48 
QuestionGridView, DetailView and Creating a New Row Pin
Pravinc198427-Oct-08 6:31
Pravinc198427-Oct-08 6:31 
QuestionAJAX update panel Pin
geletaabate27-Oct-08 6:27
geletaabate27-Oct-08 6:27 
Questionvb.net and parsing xml string Pin
KingAndyb27-Oct-08 3:57
KingAndyb27-Oct-08 3:57 
QuestionNEED HELP: Runing proces using the process.start() Pin
sSupergirl27-Oct-08 2:04
sSupergirl27-Oct-08 2:04 
AnswerRe: NEED HELP: Runing proces using the process.start() Pin
SeMartens27-Oct-08 2:30
SeMartens27-Oct-08 2:30 
GeneralRe: NEED HELP: Runing proces using the process.start() Pin
sSupergirl27-Oct-08 5:54
sSupergirl27-Oct-08 5:54 
QuestionQuery String Pin
srinivaskonijeti27-Oct-08 2:00
srinivaskonijeti27-Oct-08 2:00 
AnswerRe: Query String Pin
Kannan Ar27-Oct-08 3:44
professionalKannan Ar27-Oct-08 3:44 
GeneralRe: Query String Pin
Ridge Howison27-Oct-08 11:30
Ridge Howison27-Oct-08 11:30 
QuestionGetting dataitems from a LinqDatasource/ListView in code Pin
AntoonHzn27-Oct-08 1:36
AntoonHzn27-Oct-08 1:36 
QuestionHow this is to be done Pin
Krazy Programmer27-Oct-08 1:19
Krazy Programmer27-Oct-08 1:19 
QuestionPls Help Me..CommandName value not accessible inside ItemCommand Handler event.. Pin
Sameer-The Performer27-Oct-08 1:05
Sameer-The Performer27-Oct-08 1:05 
AnswerRe: Pls Help Me..CommandName value not accessible inside ItemCommand Handler event.. Pin
Kannan Ar27-Oct-08 3:47
professionalKannan Ar27-Oct-08 3:47 
QuestionRe: Pls Help Me..CommandName value not accessible inside ItemCommand Handler event.. Pin
Sameer-The Performer28-Oct-08 18:53
Sameer-The Performer28-Oct-08 18:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.