SqlCe on the Full Framework
Not too long ago Casey brought up the question of whether or not SqlCeResultSet will work on the Tablet for instance. Microsoft said it will. Sam brought it up again and really has my curiousity piqued. The only question was HOW TO DO IT. To that end, I started freestyling and found some neat information. 1) If you use the same .dll reference that you normally use for SqlCe - it won't work on the full framework. Not a big shock there. 2) Microsoft.SqlServerCe.Client will in fact work. Well, work is dubious thing. It will compile and run. I'm getting a connection string error which is probably the work of something really stupid I'm overlooking. If this much works though I think the rest will... So far here it is:
const string CONNECTION_STRING = @"C:\test.sdf";
private void Form1_Load(object sender, EventArgs e)
{
SqlCeConnection cn ;
SqlCeCommand cmd = new SqlCeCommand();
cn = new SqlCeConnection(CONNECTION_STRING);
try
{
cn.Open();
}
catch (SqlCeException ex)
{
Debug.Assert(false, ex.ToString());
}
}
I'm getting stuck w/ this error: "Format of the initialization string does not conform to specification starting at index 0." But I'm going to call this progress b/c it got nowhere before and it looks like it's merely a connection string problem. Will post back shortly.