private void GetBookType() { BookList btl = new BookList(); btl = btl.GetByBookTypeID(new Guid(ddlGenre.SelectedValue)); foreach (Book book in btl.List) { string filename = Path.Combine(Server.MapPath("Images"), book.ID + book.MimeType); string relativepath = string.Format("Images/{0}", book.ID + book.MimeType); book.PhotoName = relativepath; Photo.ByteArrayToFile(book.Cover, filename); } rptBooks.DataSource = btl.List; rptBooks.DataBind(); }