You can use this jquery file direclty from URL


Sunday, July 25, 2010

Hello friends,

Mostly what we do to apply jQuery validation to your form.

You download files from internet and add in your website and then use that.

but whats the guarantee that, it would be correct so here is the few URL, i am providing that you might use directly or you can even download to your website.

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> 
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script> 

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com

Code to execute database operation and return value in Integer




Hello,

Here in below code you will find, how to do database operation in function in class and that function return Integer as return value.

SqlConnection conn = new SqlConnection("Data 
Source=localhost;Database=MyDB;Integrated Security=SSPI");
SqlCommand command = new SqlCommand("InsertUser", conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@User", SqlDbType.VarChar).Value = user;
command.Parameters.Add("@Pass", SqlDbType.VarChar).Value = pass;
conn.Open();
int rows = command.ExecuteNonQuery();
conn.Close();


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com


Code to execute database operation and return value in Dataset




Hello,

Here in below code you will find, how to do database operation in function in class and that function return dataset as return value.

SqlConnection conn = new SqlConnection("Data Source=localhost;Database=Northwind;Integrated Security=SSPI");
SqlCommand command = new SqlCommand("GetProducts", conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@CategoryID", SqlDbType.Int).Value = 1;
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds, "Products");
dataGrid1.DataSource = ds;
dataGrid1.DataMember = "Products";


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com

How to create class file in Asp.Net ?




Hi,

You can just add App_Code file and add class file to this folder and copy this code to that class file and modify according to your need.

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using commonlib.Common;

/// <summary>
/// Summary description for Program
/// </summary>
public class Program
{
    #region "Fields"

    string sOperation;
    int iProgramID;
    string sProgramName;
    string sSlogan;
    string sStartTime;
    string sEndTime;
    string sDetail;
    int iCityID;
    string sStatus;

    #endregion

    #region "Construtor"
    public Program()
    {
    }

    public Program(string SOperation, int IProgramID, string SProgramName, string SSlogan, string SStartTime, string SEndTime, string SDetail, int ICityID, string SStatus)
    {
        this.sOperation = SOperation;
        this.iProgramID = IProgramID;
        this.sProgramName = SProgramName;
        this.sSlogan = SSlogan;
        this.sStartTime = SStartTime;
        this.sEndTime = SEndTime;
        this.sDetail = SDetail;
        this.iCityID = ICityID;
        this.sStatus = SStatus;
    }
    #endregion

    #region "Properties"

    public string SOperation
    {
        get { return sOperation; }
        set { sOperation = value; }
    }

    public int IProgramID
    {
        get { return iProgramID; }
        set { iProgramID = value; }
    }

    public string SProgramName
    {
        get { return sProgramName; }
        set { sProgramName = value; }
    }

    public string SSlogan
    {
        get { return sSlogan; }
        set { sSlogan = value; }
    }

    public string SStartTime
    {
        get { return sStartTime; }
        set { sStartTime = value; }
    }

    public string SEndTime
    {
        get { return sEndTime; }
        set { sEndTime = value; }
    }

    public string SDetail
    {
        get { return sDetail; }
        set { sDetail = value; }
    }

    public int ICityID
    {
        get { return iCityID; }
        set { iCityID = value; }
    }

    public string SStatus
    {
        get { return sStatus; }
        set { sStatus = value; }
    }

    #endregion

    #region "Functions"

    public int ProgramOperation(string user, string pass)
    {

        SqlConnection conn = new SqlConnection("Data Source=localhost;Database=MyDB;Integrated Security=SSPI");
        SqlCommand command = new SqlCommand("XYZ_SP_CheckProgramAvailability", conn);
        command.CommandType = CommandType.StoredProcedure;
        command.Parameters.Add("@User", SqlDbType.VarChar).Value = user;
        command.Parameters.Add("@Pass", SqlDbType.VarChar).Value = pass;
        conn.Open();
        int rows = command.ExecuteNonQuery();
        conn.Close();

    }

    #endregion
}


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com



How to give reference of other table to current table in fields?




Hello friends,

Thanks for all your support, Please read this new post to know how to give reference of other table to current table in fields.

You can find if any table with this name is exist in database of not, if you found delete it and create this one.

To do this operation use this code,

--Table Name: XYZ_SongRequest

    IF EXISTS (SELECT * FROM SYSOBJECTS WHERE ID = OBJECT_ID('XYZ_SongRequest'))
        DROP TABLE XYZ_SongRequest
    GO


Now by using below code, you can create reference of other table let say, XYZ_User, XYZ_City, XYZ_Rj to table XYZ_SongRequest

--Table Name: XYZ_SongRequest

CREATE TABLE XYZ_SongRequest (
    iRequestID            BIGINT            NOT NULL PRIMARY KEY IDENTITY(1,1),
    iMemberId            BIGINT            NOT NULL CONSTRAINT FK_SongRequest_iMemberId References XYZ_User(iMemberID),
    iCityID                INT                NOT NULL CONSTRAINT FK_SongRequest_iCityID References XYZ_City(iCityID),
    iRjId                INT                NOT NULL CONSTRAINT FK_SongRequest_iRjId References XYZ_Rj(iRJid),
    sRequest            VARCHAR(1000)    NOT NULL, 
    dRequestDate        DATETIME        NOT NULL DEFAULT GETDATE(),
    dProcessDate        DATETIME        ,
    sStatus                Varchar(20)        CHECK(sStatus in ('Pending','Approved')) NOT NULL DEFAULT 'Pending' 
)
GO


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com


How to create Stored Procedure in SQL Server 2005 or 2008 ?




Solution :

You can directly copy below code highlight and paste in sql server query window and modify according to your need.

/**********************************************************************************
SP Name : XYZ_SP_ProgramOperation
Created by : Rajesh Singh
Created Date : 13th April 2010
Modified Date : 15th April 2010 
*********************************************************************************/

IF EXISTS (SELECT * FROM SYSOBJECTS WHERE ID=OBJECT_ID('XYZ_SP_ProgramOperation'))
DROP PROCEDURE XYZ_SP_ProgramOperation
GO 
create PROCEDURE XYZ_SP_ProgramOperation
(
    @sOperation varchar(100),
    @iProgramID INT=NULL,
    @sProgramName varchar(100)=NUll,
    @sSlogan varchar(100)=NUll,
    @sStartTime varchar(100)=NUll,
    @sEndTime varchar(100)=NUll,
    @sDetail varchar(MAX)=NUll,
    @iCityID INT=NUll,
    @sStatus varchar(20)=NUll
    
)
AS
IF @sOperation='SELECT'
            BEGIN
            SELECT * FROM [XYZ_Program] WHERE sStatus='Active'
            END
ELSE IF @sOperation='SELECTPROGRAMBYID'
            BEGIN
            SELECT XYZ_Program.*, XYZ_Rj.sUserName,XYZ_Rj.sPhoto, XYZ_Rj.sRjName,(select sCityName from XYZ_City where iCityId=XYZ_Program.iCityID) as sCityName,XYZ_RjProgRel.iRjId
            FROM   XYZ_Program INNER JOIN
            XYZ_RjProgRel ON XYZ_Program.iProgramID = XYZ_RjProgRel.iProgramID INNER JOIN
            XYZ_Rj ON XYZ_RjProgRel.iRjId = XYZ_Rj.iRJid WHERE XYZ_Program.iProgramID=@iProgramID
            END
ELSE IF @sOperation='UPDATE'
            BEGIN
            UPDATE [XYZ_Program]
               SET [sSlogan] = @sSlogan
                  ,[sStartTime] = @sStartTime
                  ,[sEndTime] = @sEndTime
                  ,[sDetail] = @sDetail
                  ,[iCityID] = @iCityID
                  ,[sStatus] = @sStatus
             WHERE XYZ_Program.iProgramID=@iProgramID
            END


GO


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com


Where to put Connnectionstring in web.config file.




Hello bloggers,

Most of the developers have big confusion that, where to put connection string in web.config file,
So this article will teach you which portion you can use to write your connection string.
When you will open web.config file, you will find this tag
<connectionStrings />

Here what you can do is, just replace this string with below connectionstring.


Use this connectionstring when database is on other server or other computer.

<connectionStrings>
  
      <add name="conn" connectionString="Data Source=XYZ;Initial Catalog=DatabaseName;user id=UserId;password=Password; Max Pool Size=7500;Connect Timeout=200;" providerName="System.Data.SqlClient"/>
      
</connectionStrings>


when database is in your computer, you can use local database server.

<connectionStrings>

<add name="conn" connectionString="Data Source=localhost;Database=MyDB;Integrated Security=SSPI " providerName="System.Data.SqlClient"/>
      
</connectionStrings>


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer

e-Procurement Technologies Ltd (India)
www.abcprocure.com