perini14
Aug 5th, 2002, 06:43 AM
How to change insert command generated by oledbcommandbuilder??
For ex. I have this code that creates data adapter and commands:
Dim daTrening as OleDbDataAdapter
Dim cbTrening as OleDbCommandBuilder
daTrening = New OleDbDataAdapter("select * from trening where clan_id=" & clanid, Conn_s)
daTrening.TableMappings.Add("Table", "Trening")
daTrening.Fill(data_set)
cbTrening = New OleDbCommandBuilder(daTrening)
By executing this msgbox:
MsgBox(cbTrening.GetInsertCommand.CommandText)
I found out that commandbuilder builds this insert command:
INSERT INTO `trening`( `clan_id` , `mjesec` , `brojtreninga` , `prisustvovao` ) VALUES ( ? , ? , ? , ? )"
I need that first "?" always be the number "7". How to change that ? I've tryed to build another command object and set that
insertcommand text, but the update method of data adapter seams to ignores it and always use the commandbuilder
insertcommand.
Help !
For ex. I have this code that creates data adapter and commands:
Dim daTrening as OleDbDataAdapter
Dim cbTrening as OleDbCommandBuilder
daTrening = New OleDbDataAdapter("select * from trening where clan_id=" & clanid, Conn_s)
daTrening.TableMappings.Add("Table", "Trening")
daTrening.Fill(data_set)
cbTrening = New OleDbCommandBuilder(daTrening)
By executing this msgbox:
MsgBox(cbTrening.GetInsertCommand.CommandText)
I found out that commandbuilder builds this insert command:
INSERT INTO `trening`( `clan_id` , `mjesec` , `brojtreninga` , `prisustvovao` ) VALUES ( ? , ? , ? , ? )"
I need that first "?" always be the number "7". How to change that ? I've tryed to build another command object and set that
insertcommand text, but the update method of data adapter seams to ignores it and always use the commandbuilder
insertcommand.
Help !