I am using linq 2 sql store procedures . I didn’t change the return type of any store procedure so it is returning isingleResult<storeprocedureResult>
I make a class ”mydataconetcion” which use the datacontext class object and I am getting all store procedures in that class by
Datacontext db=new datacontext();
One example of my store procedure is
public ISingleResult<dashCommerce_Store_FetchCategoryManufacturersResult> getCategoryManufecturer(int catId)
{
ISingleResult<dashCommerce_Store_FetchCategoryManufacturersResult> CategoryManufecture = db.dashCommerce_Store_FetchCategoryManufacturers(catId);
return CategoryManufecture;
}
In my web pages I make object of mydataconetcion class
Mydataconetcion dc=new mydataconetcion();
I am storing the result in var then by foreach I am traversing it . or I simply bind it to my gridview and repetors and so on .
I am doin this
Var selectedProduct =dc. getCategoryManufecturer(7);
CatGridview.datasource= selectedProduct;
It works fine but now I want something like this
If (selectedProduct!=null )
{
CatGridview.visible=true;
CatGridview.datasource= selectedProduct;
}
Or empty or what ever condition that tell me that there is any value in selectedProduct
So help me out on this how can I make sure that there is any value or not