@Michael
I write some sample codes as you guided.
Adding the System.Data.Linnq.dll refrence was works well and the builds well too.
But on running my app the InvalidProgramException was happend.
I think that the WP8.0 and WP8.1 are differ each other very much.
This is exception call stack...
{System.InvalidProgramException: Common Language Runtime detected an invalid program.
at System.Data.Linq.DataContext..ctor(String fileOrConnection)
at KakaoTalk.Tests.LocoChatLogDataContext..ctor(String connectionString)
at KakaoTalk.Tests.SqlCeTestPage.OnNavigatedTo(NavigationEventArgs e)}
This is my sample codes...
public sealed partial class SqlCeTestPage : Page
{
public SqlCeTestPage()
{
this.InitializeComponent();
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached.
/// This parameter is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var dbCtx = new LocoChatLogDataContext("isostore:/locochatlog.sdf");
if (dbCtx.DatabaseExists() == true)
{
dbCtx.DeleteDatabase();
}
dbCtx.CreateDatabase();
}
}
public class LocoChatLogDataContext : DataContext
{
// Pass the connection string to the base class.
public LocoChatLogDataContext(string connectionString) : base(connectionString) { }
// Specify a single table for the to-do items.
public Table<LocoChatLog> Items;
}
[Table]
public class LocoChatLog : INotifyPropertyChanged
{
#region long logId PropertyChanged
long _logId;
[Column(IsPrimaryKey = true)]
public long logId
{
get
{
return _logId;
}
set
{
if (_logId != value)
{
_logId = value;
if (this.PropertyChanged != null)
{
this.PropertyChanged.Invoke(this, new PropertyChangedEventArgs(STR_logId));
}
}
}
}
public const string STR_logId = "logId";
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}