 |
WP - เขียนแอพ Windows Phone 8 ด้วย C# กับ XAML ควรใช้ Database ตัวไหนดีคะ |
|
 |
|
|
 |
 |
|
ใน Windows Phone มี Local Database มาให้ครับ
Code (C#)
public class ToDoDataContext : DataContext
{
// Specify the connection string as a static, used in main page and app.xaml.
public static string DBConnectionString = "Data Source=isostore:/ToDo.sdf";
// Pass the connection string to the base class.
public ToDoDataContext(string connectionString): base(connectionString) { }
// Specify a single table for the to-do items.
public Table<ToDoItem> ToDoItems;
}
// Define the to-do items database table.
[Table]
public class ToDoItem : INotifyPropertyChanged, INotifyPropertyChanging
{
// Define ID: private field, public property, and database column.
private int _toDoItemId;
[Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
public int ToDoItemId
{
get
{
return _toDoItemId;
}
set
{
if (_toDoItemId != value)
{
NotifyPropertyChanging("ToDoItemId");
_toDoItemId = value;
NotifyPropertyChanged("ToDoItemId");
}
}
}
ใช้การเขียนแบบ Linq
Local database for Windows Phone
How to create a basic local database app for Windows Phone
|
 |
 |
 |
 |
Date :
2013-11-03 13:00:03 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กรณีที่ต้องการ Database แบบ Online ลองดู Azure Mobile Services ครับ
Windows Phone and Mobile Services (Windows Azure)
|
 |
 |
 |
 |
Date :
2013-11-03 13:00:48 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ
|
 |
 |
 |
 |
Date :
2013-11-03 13:05:11 |
By :
ThanatthaB |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|