Here iam giving the Code You Should analize the code some sample iam giving.
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
public class District
{
public InboxCount()
{
}
private Int32 _intDistrictid;
private string strDistrictname;
public Int32 IntDistrictId
{
get { return _intDistrictid; }
set { _intDistrictid= value; }
}
public string DistrictName
{
get { return strDistrictname; }
set { strDistrictname= value; }
}
public DataTable InsertExample()
{
DataTable dt = new DataTable();
DataAcessHelper acess = new DataAcessHelper();
SqlCommand cmd = acess.CreateCommand("sp_stroreDistrict");
acess.AddParameter(cmd, "@DistrictId", SqlDbType.Int, ParameterDirection.Input, 4, IntDistrictId);
acess.AddParameter(cmd, "@Districtname", SqlDbType.VarChar, ParameterDirection.Input, 50, DistrictName);
acess.ExecuteStoredProcedure(cmd);
return dt;
}
public DataTable GetTotalMessage()
{
DataTable dt = new DataTable();
DataAcessHelper dashp = new DataAcessHelper();
SqlCommand cmd = dashp.CreateCommand("Sp_getdistrict");
dashp.AddParameter(cmd, "@DistrictId", SqlDbType.Int, ParameterDirection.Input, 4, IntDistrictId);
dt = dashp.GetDataTable(cmd);
return dt;
}
public DataTable DeleteInbox()
{
DataTable dt = new DataTable();
DataAcessHelper dashp = new DataAcessHelper();
SqlCommand cmd = dashp.CreateCommand("sp_Deletedistrict");
dashp.AddParameter(cmd, "@DistrictId", SqlDbType.Int, ParameterDirection.Input, 4, IntDistrictId);
dashp.ExecuteStoredProcedure(cmd);
return dt;
}
}
You Should analize everything then only You can understand.