Search Results

Search found 2 results on 1 pages for 'hungrycoder'.

Page 1/1 | 1 

  • Best Practice to write Connection string for heavy traffic ASP.NET Web Application

    - by hungrycoder
    What is the best way to define connection string for a web application that has minimum 500 live users on the internet in terms of connection pooling. And load factors to consider? Suppose I have connection string as follows: initial catalog=Northwind; Min Pool Size=20;Max Pool Size=500; data source=localhost; Connection Timeout=30; Integrated security=sspi" as Max Pool Size is 500 and as live users exceed 500 say 520 will the remaining 20 users experience slower page load?? Or what if I have connection string as follows which doesn't talks anything about pooling or Connection time out? How the application behaves then? initial catalog=Northwind; data source=localhost; Integrated security=sspi" I'm using "Using statements" however to access the MYSQL database.

    Read the article

  • Ajax Calendar Date Range with JavaScript

    - by hungrycoder
    I have the following code to compare two dates with the following conditions Scenario: On load there are two text boxes (FromDate, ToDate) with Ajax calendar extenders. On load From Date shows today's date. when date less than today was selected in both text boxes(FromDate, ToDate), it alerts user saying "You cannot select a day earlier than today!" When ToDate's Selected date < FromDate's Selected Date, alerts user saying "To Date must be Greater than From date." and at the same time it clears the selected Date in ToDate Text box. Codeblock: ASP.NET , AJAX <asp:TextBox ID="txtFrom" runat="server" ReadOnly="true"></asp:TextBox> <asp:ImageButton ID="imgBtnFrom" runat="server" ImageUrl="~/images/Cal20x20.png" Width="20" Height="20" ImageAlign="TextTop" /> <asp:CalendarExtender ID="txtFrom_CalendarExtender" PopupButtonID="imgBtnFrom" runat="server" Enabled="True" OnClientDateSelectionChanged="checkDate" TargetControlID="txtFrom" Format="MMM d, yyyy"> </asp:CalendarExtender> <asp:TextBox ID="txtTo" runat="server" ReadOnly="true"></asp:TextBox> <asp:ImageButton ID="imgBtnTo" runat="server" ImageUrl="~/images/Cal20x20.png" Width="20" Height="20" ImageAlign="TextTop" /> <asp:CalendarExtender ID="txtTo_CalendarExtender" OnClientDateSelectionChanged="compareDateRange" PopupButtonID="imgBtnTo" runat="server" Enabled="True" TargetControlID="txtTo" Format="MMM d, yyyy"> </asp:CalendarExtender> <asp:HiddenField ID="hdnFrom" runat="server" /> <asp:HiddenField ID="hdnTo" runat="server" /> C# Code protected void Page_Load(object sender, EventArgs e) { txtFrom.Text = string.Format("{0: MMM d, yyyy}", DateTime.Today); if (Page.IsPostBack) { if (!String.IsNullOrEmpty(hdnFrom.Value as string)) { txtFrom.Text = hdnFrom.Value; } if (!String.IsNullOrEmpty(hdnTo.Value as string)) { txtTo.Text = hdnTo.Value; } } } JavaScript Code <script type="text/javascript"> function checkDate(sender, args) { document.getElementById('<%=txtTo.ClientID %>').value = ""; if (sender._selectedDate < new Date()) { alert("You cannot select a day earlier than today!"); sender._selectedDate = new Date(); // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format)); //assign the value to the hidden field. document.getElementById('<%=hdnFrom.ClientID %>').value = sender._selectedDate.format(sender._format); //reset the to date to blank. document.getElementById('<%=txtTo.ClientID %>').value = ""; } else { document.getElementById('<%=hdnFrom.ClientID %>').value = sender._selectedDate.format(sender._format); } } function compareDateRange(sender, args) { var fromDateString = document.getElementById('<%=txtFrom.ClientID %>').value; var fromDate = new Date(fromDateString); if (sender._selectedDate < new Date()) { alert("You cannot select a Date earlier than today!"); sender._selectedDate = ""; sender._textbox.set_Value(sender._selectedDate) } if (sender._selectedDate <= fromDate) { alert("To Date must be Greater than From date."); sender._selectedDate = ""; sender._textbox.set_Value(sender._selectedDate) } else { document.getElementById('<%=hdnTo.ClientID %>').value = sender._selectedDate.format(sender._format); } } </script> Error Screen(Hmmm :X) Now in ToDate, when you select Date Earlier than today or Date less than FromDate, ToDate Calendar shows NaN for Every Date and ,0NaN for Year

    Read the article

1