Y
Y
yury_yatskov2014-12-26 00:33:02
SQLite
yury_yatskov, 2014-12-26 00:33:02

How to create relationships between WinRT+SQLite+C#+Linq tables?

Liked this article Working with data in WinRT. Part 2. Working with the database on ...
Please help me go beyond examples with WinRT+SQLite+C#+Linq technologies.
1. Not enough knowledge of how to create a table and links to other tables through the Linq provider. How to describe fields with “Foreign Key”? How to describe the prohibition of NULL values? The presented example is simple, with only one table. I need an example of creating three tables, for example:
- “Products” with the fields “Id, Name”,
- “Companies” with the fields “Id, Name”,
- “Orders”, with the fields “Id, Date, Number, ProductId, Id Companies, Quantity”.
2. Is there a visual SQLite database editor, in which, after creating the database, it was possible to generate program code in C # + Linq (table classes, relationships ...)?
3. In which element of the “Grid, GridView” form is it more correct to display data from the “Orders” table?
4. Are there any examples where these four technologies are considered together?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yury_yatskov, 2014-12-26
@yury_yatskov

I got such a class, but it doesn't work
public class Orders
{
[PrimaryKey, AutoIncrement]
public int OrdersId { get; set; }
[MaxLength(250)]
public string Name { get; set; }
public DateTime Date { get; set; }
[MaxLength(10)]
public string Namber { get; set; }
private EntityRef _Companies;
[Association(Storage = "_Companies", OtherKey = "CompanyId")]
public EntityRef Companies
{
get { return this._Companies; }
set { this._Companies.Assign(value); }
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question