u use objectdatasource to bind.
in this there are following properties
1. TypeName= name of class
2. SelectMethod= name of the method of this class by which we get the data.
3.UpdateMethod= name of method of this class by which we update data.
4.InsertMethod,5.DeleteMethod= same as Point 3 for insert and delete data method of class.
<asp:GridView
id="grd1"
DataSourceID="ObjectDataSource1"
Runat="server" />
<asp:ObjectDataSource
id="ObjectDataSource1"
TypeName="ClsDataSource"
SelectMethod="FillGrid"
Runat="server" />
public class ClsDataSource
{
public ClsDataSource()
{
}
public DataTable FillGrid()
{
DataTable dt=new DataTable();
return dt;
}
}