Click here to Skip to main content
16,007,126 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to install asp.net roles n membership database on remote server Pin
bonkers12328-Oct-08 1:34
bonkers12328-Oct-08 1:34 
GeneralRe: how to install asp.net roles n membership database on remote server Pin
dream_liner_7e728-Oct-08 2:26
dream_liner_7e728-Oct-08 2:26 
QuestionMaster Page Dropdown Problem! Pin
mr_muskurahat27-Oct-08 21:02
mr_muskurahat27-Oct-08 21:02 
AnswerRe: Master Page Dropdown Problem! Pin
luckeryin27-Oct-08 21:27
luckeryin27-Oct-08 21:27 
QuestionHow to show bargraph in asp.net webpages Pin
Member 395908427-Oct-08 20:48
professionalMember 395908427-Oct-08 20:48 
AnswerRe: How to show bargraph in asp.net webpages Pin
mr_muskurahat27-Oct-08 21:04
mr_muskurahat27-Oct-08 21:04 
GeneralRe: How to show bargraph in asp.net webpages Pin
LloydA11129-Oct-08 6:49
LloydA11129-Oct-08 6:49 
QuestionOnline shopping using MIGS Pin
Blumen27-Oct-08 19:45
Blumen27-Oct-08 19:45 
QuestionAsp.net 2.0 with MYSQL Database server help is needed Pin
Rameez Raja27-Oct-08 18:46
Rameez Raja27-Oct-08 18:46 
AnswerRe: Asp.net 2.0 with MYSQL Database server help is needed Pin
AhsanS27-Oct-08 20:47
AhsanS27-Oct-08 20:47 
AnswerRe: Asp.net 2.0 with MYSQL Database server help is needed Pin
N a v a n e e t h27-Oct-08 21:59
N a v a n e e t h27-Oct-08 21:59 
QuestionASP Menu Controls and Query Strings Pin
RB@Emphasys27-Oct-08 18:28
RB@Emphasys27-Oct-08 18:28 
QuestionHow prevent duplicate record run update statement else Insert Statement Pin
zjaffary27-Oct-08 16:58
zjaffary27-Oct-08 16:58 
AnswerRe: How prevent duplicate record run update statement else Insert Statement Pin
Kannan Ar27-Oct-08 18:56
professionalKannan Ar27-Oct-08 18:56 
AnswerRe: How prevent duplicate record run update statement else Insert Statement Pin
meeram39527-Oct-08 21:04
meeram39527-Oct-08 21:04 
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 

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.