SQL Server CE Programming with Pocket PC and Visual Studio.NET 2003: Databases and Tables
(Page 1 of 4 )
This article is focused on developing SQL Server CE based applications using a Pocket PC emulator with Visual Studio.NET 2003. We will program to create databases and tables for SQL Server CE using Pocket PC together with Visual Studio.NET 2003.
I suggest that you download and install Pocket PC 2003 SDK (available free) and the additional latest Pocket PC emulators from the Microsoft website. I use them in this article.
If you are new to mobile application development (or confused with Windows mobile, smart phone, Windows CE, Pocket PC, and so on), I strongly suggest you go through the article I already contributed on “Developing Pocket PC applications using Visual Studio.NET 2003” before proceeding further.
If you are new to SQL Server CE based development using Pocket PC, I strongly suggest you go through another introductory article of mine here.
Creating SQL Server CE databases and tables in Pocket PC programmatically: Layout
In my previous articles, I introduced developing simple applications and Microsoft SQL Server CE based applications using Pocket PC emulator with Visual Studio.NET 2003.
In this article, I shall deal with creating databases and tables in SQL Server CE database programmatically (or dynamically).
Let us begin now:
- Open Microsoft Visual Studio.NET 2003.
- Go to File -> New -> Project.
- Within the “New Project” Dialog, select “Visual Basic Projects” from the “Project Types” and “Smart Device Application” from the “templates.” I left the name of the application “SmartDeviceApplication1.” You can change it according to your requirements.
- Once you click “OK,” you will be presented with the “Smart Device Application Wizard.” Select “Pocket PC” as the platform of target and “Windows application” as “project type.”
- Click “OK” to accept your settings. You will be presented with a form (very similar to a Visual Basic 6 form) where you can design with the controls available in toolbox.
- Right click on your project and go to “Add References.” Select “System.data.common” and “System.data.SqlServerCE,” click “select” and finally click on “OK.”
- Drag a “TabControl” from your toolbox onto the form and add a tab using the property “TabPages” in the “Properties” window. Name the tab “Create.”
- Drag a “Button” onto the tab and give it the caption “CreateTable” (name it “btnCreateTable”). By this time, your form should look as follows (fig1):

Actually “TabControl” is not necessary. I simply wanted to demonstrate the tab control, we shall extend its use in my future articles! In the next section we shall write the code for that button.
Next: Creating SQL Server CE databases and tables in Pocket PC programmatically: source code >>
More MS SQL Server Articles
More By Jagadish Chaterjee