Using Entity Frame Work [Resolved]

Posted by Saratvaddilli under ASP.NET on 9/13/2012 | Points: 10 | Views : 2254 | Status : [Member] [MVP] | Replies : 1
hi to every one,
BuybooksDataBaseEntities db = new BuybooksDataBaseEntities();
DataTable table = new DataTable();
table = db.DisplayImages; // its showing that cannot implicitly convert object set to datatable
so i tried this
object obj=db.displayimages;
in my Dal:
public object LoadImages()
{ BuybooksDataBaseEntities db = new BuybooksDataBaseEntities();
var tabletest = db.DisplayImages;

return tabletest;

}

in my BAL
public object LoadImages()
{
BuyBooksDAL.BuyBooksDal dal = new BuyBooksDAL.BuyBooksDal();
return dal.LoadImages();
}

in Aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
GetImage();
}
private void GetImage()
{
BuyBooksBAL.BuyBooksBal bal = new BuyBooksBAL.BuyBooksBal();
object obj = bal.LoadImages();
lv1.DataSource = obj;
< Here before binding i want filter the table; i had a column category so i want to filter like this category="Stephen Hawking " >
lv1.DataBind();
}


Please Help Me .......

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are



Responses

Posted by: Chikkanti on: 9/17/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi To learn about Entity Framework using conditions and edit update and delete operations refer following links..
http://chikkanti.wordpress.com/2011/11/11/editupdatedelete-in-gridview-using-edm-with-linq/
http://chikkanti.wordpress.com/entity-frameworkedm/
http://chikkanti.wordpress.com/2012/02/09/how-to-retrieve-data-from-database-using-entityframework/

chikkanti

Saratvaddilli, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response