Code: Select all
CREATE TABLE [dbo].[Category](
[CategoryID] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ParentCategoryID] [uniqueidentifier] NULL,
[Name] [nvarchar](255) NOT NULL,
[Description] [nvarchar](1024) NULL,
CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED
DataSource -> ClientDataSet -> DataSetProvider -> TMSQuery
The TMSQuery.SQL.Text is:
Code: Select all
TMSQuery.SQL.Text := 'SELECT * FROM [Category] WHERE [CategoryID]=:CategoryID;';
All fields have been added to both the TMSQuery component AND the ClientDataSet. The parameter has also been added to the ClientDataSet.
When the system inserts a new record, I do the following (the CategoryID parameter value is NIL as it will be created on the server):
Code: Select all
ClientDataSet.Open;
ClientDataSet.Append;
ClientDataSetName.AsString := 'Test';
ClientDataSet.ApplyUpdates(0);
Best Regards,
Tom Reiertsen