Hello.Maybe I can help you :D
First : this is funtion in Data access layer
DataLinqDataContext db=new DataLinqDataContext();
public List<Customer> customer()
{
List<Customer> newlist=new List<Customer>();
var c=db.Sploadcustomer(); //sploadcustomer is name store procedure
//this is field i want.
foreach (var item in c)
{
Customer cus = new Customer();
cus.CustomerID = item.CustomerID;
cus.CompanyName = item.CompanyName;
cus.City = item.City;
newlist.Add(cus);
}
return newlist;
}
Second : this is funtion in Bussiness
Dataacces ac=new Dataacces //dataacces is name of class Data access
public List<Customer> customer() //<customer> is table in Database
{
return ac.customer();
}</customer>
Finalny :Display on web
CustomerBus c = new CustomerBus();
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = c.customer();
GridView1.DataBind();
}
And entity it in datacontext
So it done.
If you don't understand you can contact with me.
Facebook.Thắng cv