This question is locked. New answers and comments are not allowed.
Hi,
I have a lot of questions regarding the Data Storage Component that ships with XAML Suite for Windows 8. After reading the documentation I experimented with retrieval of data from a local storage database.
To start with.
I referenced the Telerik Data Storage for Windows 8.1 and Telerik UI for Windows 8.1
I copied an existing SQLite database to the application and copied it to the application run time folder.
And I used the following code to retrieve data from the database
var dbpath = new Telerik.Storage.Extensions.Context("demo.db", DatabaseLocation.Local);
var stringSQL = string.Format(@"select userid, firstname, lastname from users");
var p = dbpath.Get<Users>(stringSQL);
var k = p.Count;
this.SummaryGrid.ItemsSource = new List<Users>();
where Users is the class defined for the objects in the users table and SummaryGrid is a Telerik RADGrid control.
I am getting this error "Class 'Users' used as persistent class has more than one primary key columns. Each table may have at most one Primary Key." and then it is impossible to populate the grid. But I am getting the number of rows from the table.
My questions for Data Storage are
1. If I use a SQLite database and then use the Telerik Data Storage for Windows 8.1 are they compatible. Will it cause any problems.
2. When creating classes from tables in SQLite we use this [SQLite.PrimaryKey] for the column in the classes and it works when updating tables.
What is the equivalent when using Telerik Data Storage.
3. The primary reason I am trying out Telerik Data Storage is we can pass SQL Statements for updating whereas in SQLite we can pass only the object name.
And for your information, I was able to populate the Telerik RAD Grid from a SQLite database when using the sqlite-net libraries and the SQLite library for Windows 8.1.
Thanks,
Rajesh.
I have a lot of questions regarding the Data Storage Component that ships with XAML Suite for Windows 8. After reading the documentation I experimented with retrieval of data from a local storage database.
To start with.
I referenced the Telerik Data Storage for Windows 8.1 and Telerik UI for Windows 8.1
I copied an existing SQLite database to the application and copied it to the application run time folder.
And I used the following code to retrieve data from the database
var dbpath = new Telerik.Storage.Extensions.Context("demo.db", DatabaseLocation.Local);
var stringSQL = string.Format(@"select userid, firstname, lastname from users");
var p = dbpath.Get<Users>(stringSQL);
var k = p.Count;
this.SummaryGrid.ItemsSource = new List<Users>();
where Users is the class defined for the objects in the users table and SummaryGrid is a Telerik RADGrid control.
I am getting this error "Class 'Users' used as persistent class has more than one primary key columns. Each table may have at most one Primary Key." and then it is impossible to populate the grid. But I am getting the number of rows from the table.
My questions for Data Storage are
1. If I use a SQLite database and then use the Telerik Data Storage for Windows 8.1 are they compatible. Will it cause any problems.
2. When creating classes from tables in SQLite we use this [SQLite.PrimaryKey] for the column in the classes and it works when updating tables.
What is the equivalent when using Telerik Data Storage.
3. The primary reason I am trying out Telerik Data Storage is we can pass SQL Statements for updating whereas in SQLite we can pass only the object name.
And for your information, I was able to populate the Telerik RAD Grid from a SQLite database when using the sqlite-net libraries and the SQLite library for Windows 8.1.
Thanks,
Rajesh.