Using Linq with Ms SQL.
I do have a table, with it's
ID as uniqueidentifier and a column called row_version which is TimeStamp.
The id field is set to EntityKey and the field row_version is set to isVersion=true
Creation:
Code: Select all
CREATE TABLE dbo.bezart (
id UNIQUEIDENTIFIER NOT NULL DEFAULT ('newsequentialid()'),
text NVARCHAR(50) DEFAULT '',
rechnungstext NVARCHAR(256) DEFAULT '',
sofort BIT,
[_rowVersion] TIMESTAMP NOT NULL,
geloescht BIT NOT NULL DEFAULT 1,
CONSTRAINT PK_bezart PRIMARY KEY (id)
)
Code: Select all
locDestinationDataContext.Bezarts.InsertOnSubmit(New Destination.DestinationContext.Bezart With {.Geloescht = False, _
.ID = Guid.NewGuid, _
.Text = "Bar", _
.Sofort = True, _
.Rechnungstext = "Betrag dankend in bar erhalten"})
Code: Select all
INSERT INTO dbo.bezart (text, rechnungstext, sofort, geloescht) VALUES (@p1, @p2, @p3, @p4);
SELECT id, [_rowVersion] FROM dbo.bezart WHERE id = SCOPE_IDENTITY();
-- p1: Input NVarChar (Size = 3; DbType = String) [Bar]
-- p2: Input NVarChar (Size = 30; DbType = String) [Betrag dankend in bar erhalten]
-- p3: Input Bit (Size = 0; DbType = Boolean) [True]
-- p4: Input Bit (Size = 0; DbType = Boolean) [False]
-- key1: Input UniqueIdentifier (Size = 0; DbType = Guid) [f27a74c8-3f5f-47c9-b783-ef32d186bde1]
-- Context: Devart.Data.SqlServer.Linq.Provider.SqlDataProvider Mapping: AttributeMappingSource Build: 4.4.735.0
PLEASE HELP - THX