How to: Display Data on a Form
Displaying data on a Windows Form is easy with Visual C# Express Edition. You can connect to a database in SQL Server Compact 3.5 by using the Data Sources window, and then drag data-bound controls to a Windows Form.
To display data on a form
On the File menu, click New Project.
In the New Project dialog box, click Windows Application, and then click OK.
A new Windows Forms project opens.
Add a connection to the sample database named Northwind.sdf as described in How to: Connect to a Database (C#). In step 12, select the check box for Customers and then click Finish.
On the Data menu, click Show Data Sources.
The Data Sources window opens.
In the Data Sources window, expand NorthwindDataSet, and then click the Customers table.
Click the drop-down arrow next to the Customers table and then click Details.
Drag the Customers table to Form1.
Press F5 to run the project.
When the application opens, click the Move next button on the customersBindingNavigator control at the top of the form.
The Windows Form moves to the next record in the dataset every time that you click the Move next button.