Hello Dear, I am new into the word of C#. I am trying to design a windows form application that have to do with a SDF database. I want an SQL statement that will fetch data from the related tables and display them in the labels on the form.
thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amira BedhiafiPosted Mar 3, 2025, 1:39 PM
First, you need to create the database and tables with the necessary relationships. For example, let's assume you have two tables: Customers and Orders.
Insert some sample data into the tables:
In your Windows Forms application, you need to connect to the SDF database using the SqlCeConnection class.
In your Windows Forms designer, add labels to display the data:
- lblCustomerName
- lblOrderID
- lblOrderDate
When you run the application, it will fetch the data from the related tables (Customers and Orders) and display it in the labels on the form.