Hello. Right now i'm exploring LINQ-to-SQL using Visual Studio 2010 beta. I'm trying to understood the bascis for now, without magics light code auto generated from schemes and from sqlmetal. I have tried the following code:
public class Database : DataContext
{
public Database( string s ) : base( s ) {}
public Table< DUser > items;
}
[Table( Name = "users" )]
public class Item
{
[Column]
public string s;
}
// Using SQL Compact.
var db = new Database( "Data Source=test.sdf;" );
// Works fine and creates database.
db.CreateDatabase();
But how to ADD data to database created / opened? Tutorials i have read shows something like db.Items.Add(), but Table<> don't have Add() member :(. Any insigths without using scheme / sqlmetal?