locked
C# Connection String for Pocket PC RRS feed

  • Question

  • I have a sdf databse file 'database1.sdf' that is located in the 'My Documents' folder of a pocket PC.

    I am trying to connect to the sdf file using C# and fill a datable with the contents of the sdf file.

    I have been able to acheive this quite easily with a desktop using an mdf file but i cannot seem to get the conenction to work on teh pocket pc with sdf file,

    LocalConnection.ConnectionString = "Data Source= Database1.sdf;Persist Security Info=False";//one of many i have tried!

    LocalConnection.Open();

    _DataAdapter = new SqlDataAdapter("Select * From table", LocalConnection);

    SqlCommandBuilder CB = new SqlCommandBuilder(_DataAdapter);

    _DataAdapter.Fill(_DataTable);

    any advice appreciated

    Sunday, February 8, 2009 8:25 PM

Answers