Skip to main content

Posts

Showing posts from 2012

crystal reports using stored procedures in asp.net

  crystal reports using stored procedures in asp.net   ReportDocument document = new ReportDocument ();         document.Load( this .Page.Server.MapPath( "~/CRY/crTest.rpt" ));         string str = ConfigurationManager .AppSettings[ "ConnectionString" ];         string server = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string database = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string user = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string password = str.Substring(str.IndexOf( "=" ) + 1);         document.DataSource

Call server side method using javascript

Call server side  method using javascript    ServerSide Method:- System.Web.Services.WebMethod] public static string SetDownloadPath(string ID) { HttpContext.Current.Session["logo"] = ID; return ID; }   Javascript To Call:- PageMethods.SetDownloadPath(id); Need To change in Following:- <cc1:ToolkitScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release"         EnablePageMethods="true"> </cc1:ToolkitScriptManager> EnablePageMethods="true"

Postback Page using Javascript in ASP.net

Postback Page using Javascript in ASP.net For Calling Function: __doPostBack('__Page', ''); Function: function __doPostBack(eventTarget, eventArgument) {         if (!theForm.onsubmit || (theForm.onsubmit() != false)) {             theForm.__EVENTTARGET.value = eventTarget;             theForm.__EVENTARGUMENT.value = eventArgument;             theForm.submit();         }     }

File Upload with Update Panel

ASPX Page < asp : UpdatePanel ID ="UpdatePanel1" runat ="server">             < Triggers >                 < asp : PostBackTrigger ControlID ="Button2" />                             </ Triggers >             < ContentTemplate >                 < asp : Label ID ="Label1" runat ="server"></ asp : Label >                 < asp : FileUpload ID ="fupLogo" runat ="server" Visible ="False"></ asp : FileUpload >                 < asp : Button ID ="Button2" runat ="server" Text ="Upload" OnClick ="Button2_Click" Visible ="False" />                 < asp : Button ID ="Button1" runat ="server" OnClick ="Button1_Click" Text ="show Uploader " />             </ ContentTemplate >         </ asp : UpdatePanel

Simple Cursor Example in SQL

    DECLARE @Pram int     DECLARE aCursor CURSOR     FOR         SELECT             *                     FROM             TableName                 OPEN aCursor                     FETCH NEXT FROM aCursor INTO         @Pram             WHILE @@FETCH_STATUS = 0         BEGIN             --'what you want to do hear'             FETCH NEXT FROM aCursor INTO                 @Pram         END     CLOSE aCursor     DEALLOCATE aCursor

Date Picker control for ASP.net using Dropdown control of DD,MM,YYYY

Date Picker control for ASP.net using Dropdown control of DD,MM,YYYY .aspx File <asp:DropDownList ID="ddlDay" Width="60px" runat="server"> </asp:DropDownList> <asp:DropDownList ID="ddlMonth" Width="120px" runat="server"> </asp:DropDownList> <asp:DropDownList ID="ddlYear" Width="80px" runat="server"> </asp:DropDownList> &nbsp; <%--<asp:Image ID="imgCalendar" runat="server" ImageUrl="~/Images/calendar.gif"     EnableViewState="False"></asp:Image>--%> <asp:Label ID="lblError" runat="server" CssClass="error" Visible="False" EnableViewState="False"><BR />The date is not valid.</asp:Label> .cs File public partial class DateTimePicker : System.Web.UI.UserControl { // Fields private DateTime _dateTime; private int