tags:

views:

38

answers:

1

I am using linq to sql.

Currently i am binding gridview through linq which query written in business logic call.I have extract record through query in business logic class and i want to bind that particular data to gridviw and return data. How to retrun data which type is array? The code is mention below:

CMSBusiness.DataClasses1DataContext db = new DataClasses1DataContext();
var cate = 
      from p in db.categoryTables
      select new 
      {
           categoryId=p.categoryId,
           categoryName=p.categoryName,
           categoryDesc=p.categoryDesc
      };

how to return value and bind gridview?

A: 

Try

gridView.DataSource = cate;
, this should work.
We also recommend you to take a look at this article.

Devart