cybercrypt13

I've just finished going through the tutorial for creating a data Access Layer and a Business Logic layer on the following link. The problem I'm having at the moment is while both layers appear to be working I'm not sure how to bind controls to the business layer.

To make things short, I have a data access layer that basically connects to my table.

I then have a business logic layer that has methods that call into the data access layer for retrieving the information. The tutorial uses the following code to do the final linking but I don't have the last command it lists.

The productsBLL type is the business logic layer it had me create during the excercise but the gridview1.databind() doesn't seem to exist in my system. The tutorial was meant for ASP and I'm doing a windows form so perhaps that is why I don't have it. Is there another method to call to get the grid to link The grid seems to have the data in it based on debugging after I call the datasource = line. But it doesn't display anything. I'd really like to access the data at design time if anyone could tell me how, because I'd be able to customize the look of my grids instead of having to do it all through code.

ProductsBLL productLogic = new ProductsBLL();
GridView1.DataSource = productLogic.GetProducts();
GridView1.DataBind();
Thanks,
glenn



Re: Windows Forms General Binding a Business Logic Layer to a control

Zhi-Xin Ye - MSFT

In windows forms application, for DataGridView control, it has not DataBind() method, what you have to do is setting the DataSource and DataMember for the DataGridView.