** For this example I will be using Visual Studio 2008 and SQL Server 2008Here are the steps for resolving that issue:
1. First of all download and install the Virtual PC. Because this is required to set up the Virtual Machine Network Driver for Microsoft Device Emulator (http://go.microsoft.com/fwlink/?linkid=46859). The installation process is a pretty straight forward one and make sure that the Visual Studio IDE or the Smart Device Emulator is not running.
2. From network settings, right click on the Local Area Network (Network Connection) and select Properties and make sure that the Virtual Machine Network Services option is checked
![img_01_network_properties img_01_network_properties](http://lh3.ggpht.com/_zprglM1x5x4/S9hGqQBlMPI/AAAAAAAAAEc/BciOShzM6bg/img_01_network_properties_thumb%5B1%5D.png?imgmax=800)
3. For this I will be using the sample “Adventure Works Database”, and it can be downloaded from the CodePlex community site (http://msftdbprodsamples.codeplex.com/releases/view/37109)
4. Open Visual Studio IDE. Create a new Smart Device project. Use any name (Here I have used SampleSmartDeviceApplication) and select required framework from the list (I have chosen 3.5)
![img_02_new_project_visual_studio_2008 img_02_new_project_visual_studio_2008](http://lh3.ggpht.com/_zprglM1x5x4/S9hGwYRR-aI/AAAAAAAAAEk/LYeUiybdJjM/img_02_new_project_visual_studio_2008_thumb%5B1%5D.png?imgmax=800)
5. Choose the target platform, .NET Compact Framework and the Template from the next screen. I have chosen “Pocket PC 2003”, “.Net Compact Framework Version 2.0” and “Device Application”.
![img_03_target_platform_framework img_03_target_platform_framework](http://lh3.ggpht.com/_zprglM1x5x4/S9hG2GW-phI/AAAAAAAAAEs/rU1oDJWJ9is/img_03_target_platform_framework_thumb%5B3%5D.png?imgmax=800)
6. In Visual Studio IDE open Tools—>Options. And from the window select Device Tools—>Devices and choose your device (I have chosen Pocket PC 2003 SE Emulator)
![img_05_device_tools_options img_05_device_tools_options](http://lh4.ggpht.com/_zprglM1x5x4/S9hG7_4wfPI/AAAAAAAAAE0/R1_ZOujc3ro/img_05_device_tools_options_thumb%5B1%5D.png?imgmax=800)
7. Click on the properties button and from the device properties window, select “TCP Connect Transport” as the Transport and click on the Configure… button.
![img_06_smart_device_emulator_properties img_06_smart_device_emulator_properties](http://lh5.ggpht.com/_zprglM1x5x4/S9hG_oGOHUI/AAAAAAAAAE8/EyBh0TH02dg/img_06_smart_device_emulator_properties_thumb%5B4%5D.png?imgmax=800)
8. And use select the option “Use specific IP address” and type an appropriate IP address. (I have typed 192.168.0.190 since my development machine IP address is 192.168.0.198)
![img_07_configure_tcp_ip_transport img_07_configure_tcp_ip_transport](http://lh5.ggpht.com/_zprglM1x5x4/S9hHCZubr3I/AAAAAAAAAFE/v-US7XQaGNE/img_07_configure_tcp_ip_transport_thumb%5B1%5D.png?imgmax=800)
9. Click ok and close the TCP/IP Transport window. Click on the Emulator button. And from the Emulator Properties window select the Network tab and check on the “Enable NE2000 PCMCIA network adapter and bind to” and select your network adapter.
![img_08_configure_emulator_properties img_08_configure_emulator_properties](http://lh6.ggpht.com/_zprglM1x5x4/S9hHFvJngAI/AAAAAAAAAFM/j2yCsRqA_-8/img_08_configure_emulator_properties_thumb%5B1%5D.png?imgmax=800)
10. Click the ok button and close the window. And click on the ok button and close the Smart Device Emulator properties window. Click on the OK button and close the Options window.
11. Add a button (button1) and a Grid (dataGrid1) to the form. And add the “System.Data.SqlClient” reference to the project.
![img_04a_controls_added_to_form img_04a_controls_added_to_form](http://lh3.ggpht.com/_zprglM1x5x4/S9hHIjus5_I/AAAAAAAAAFU/uFcLbPa5Y3k/img_04a_controls_added_to_form_thumb%5B3%5D.png?imgmax=800)
12. Double click on the button and add the following code.
string zCon = "Password=blogpassword;Persist Security Info=True;
User ID=bloguser;Initial Catalog=AdventureWorks;
Data Source=192.168.0.198\\sql2k8";
SqlConnection objCon = new SqlConnection(zCon);
objCon.Open();
SqlCommand objCommand = new SqlCommand("select ProductID,Name,ProductNumber from Production.Product", objCon);
DataSet dsData = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(objCommand);
da.Fill(dsData);
dataGrid1.DataSource = dsData.Tables[0];
objCon.Close();
13. Run the application and select Pocket PC 2003 SE Emulator and click on deploy.
![img_04b_run img_04b_run](http://lh3.ggpht.com/_zprglM1x5x4/S9hHN1sD9aI/AAAAAAAAAFc/-cFGX15FFRI/img_04b_run_thumb%5B2%5D.png?imgmax=800)
14. Click on the “button1”. Then you get the following results.
![img_04b_run_a img_04b_run_a](http://lh5.ggpht.com/_zprglM1x5x4/S9hHUSbjD_I/AAAAAAAAAFk/du2g-vsyZPc/img_04b_run_a_thumb%5B1%5D.png?imgmax=800)