title: Connecting to SQL Server DB
body: <p>I created a simple Windows CE application with Visual Studio 2008 using Compact Framework 3.5. I am using SQL server 2008 on the same PC. How can I connect to the database from my application?  Currently I am using the Visual Studio Device Emulator.</p>
  
  <p>I tried this:</p>
  
  <pre><code>DataTable dt=new DataTable();
  SqlConnection SqlConn = new SqlConnection(@"DataSource=192.168.10.127,1433;Initial Catalog=school;Integrated Security=SSPI;");
  SqlCommand cmd=new SqlCommand("select * from students",SqlConn);
  SqlDataAdapter dr=new SqlDataAdapter();
  dr.SelectCommand=cmd;
  dr.Fill(dt);
  dataGrid1.DataSource = dt;
  </code></pre>
  
  <p>But exceptions occurred. Please help.</p>