M
MobileBoy36
Hi group,
I'm using CF 2.0 (VS 2005) and SQLCE 3.0.
- My table looks like:
create table Action
(
ActionId nvarchar(10) not null,
Description nvarchar(25) not null,
constraint Action_PK primary key (ActionId)
);
- My sub looks like:
Public Sub ADAPTERTEST()
Dim DataAdapter As SqlServerCe.SqlCeDataAdapter
Dim CommandBuilder As SqlServerCe.SqlCeCommandBuilder
DataAdapter = New SqlServerCe.SqlCeDataAdapter("Select ActionId,
Description from Action", _Db.DbConnection)
CommandBuilder = New
System.Data.SqlServerCe.SqlCeCommandBuilder(DataAdapter)
DataAdapter.InsertCommand = CommandBuilder.GetInsertCommand
DataAdapter.UpdateCommand = CommandBuilder.GetUpdateCommand
DataAdapter.DeleteCommand = CommandBuilder.GetDeleteCommand
End Sub
- My question:
The commandbuilder generates the following UpdateQuery:
UPDATE [Action] SET [ActionId] = @p1, [Description] = @p2
WHERE (([ActionId] = @p3) AND ([Description] = @p4))
Description is not part of the PK_key...
So why is ([Description] = @p4)) part of the where clause?
How can I prevent the commandbuilder adding it to the where clause?
So that the updatequery looks like:
UPDATE [Action] SET [ActionId] = @p1, [Description] = @p2
WHERE ([ActionId] = @p3)
Or, what do I have to do If I don't can/want specify @p4?
Best regards,
Mobile boy
I'm using CF 2.0 (VS 2005) and SQLCE 3.0.
- My table looks like:
create table Action
(
ActionId nvarchar(10) not null,
Description nvarchar(25) not null,
constraint Action_PK primary key (ActionId)
);
- My sub looks like:
Public Sub ADAPTERTEST()
Dim DataAdapter As SqlServerCe.SqlCeDataAdapter
Dim CommandBuilder As SqlServerCe.SqlCeCommandBuilder
DataAdapter = New SqlServerCe.SqlCeDataAdapter("Select ActionId,
Description from Action", _Db.DbConnection)
CommandBuilder = New
System.Data.SqlServerCe.SqlCeCommandBuilder(DataAdapter)
DataAdapter.InsertCommand = CommandBuilder.GetInsertCommand
DataAdapter.UpdateCommand = CommandBuilder.GetUpdateCommand
DataAdapter.DeleteCommand = CommandBuilder.GetDeleteCommand
End Sub
- My question:
The commandbuilder generates the following UpdateQuery:
UPDATE [Action] SET [ActionId] = @p1, [Description] = @p2
WHERE (([ActionId] = @p3) AND ([Description] = @p4))
Description is not part of the PK_key...
So why is ([Description] = @p4)) part of the where clause?
How can I prevent the commandbuilder adding it to the where clause?
So that the updatequery looks like:
UPDATE [Action] SET [ActionId] = @p1, [Description] = @p2
WHERE ([ActionId] = @p3)
Or, what do I have to do If I don't can/want specify @p4?
Best regards,
Mobile boy