Click here to Skip to main content
12,700,256 members (36,024 online)
Rate this:
Please Sign up or sign in to vote.
I am inserting Data into sql server db and use ADODB Command to execute the sql query.

"command.Execute(out rowsAffected, ref missing, (int)ExecuteOptionEnum.adExecuteNoRecords)"

and add the the affected rows into recordset using this cmd :
"recordSet.Open(command, missing, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockReadOnly)"

the command is executed without error even the data is added to recordset but the data is not actually inserted(commited) to database.

no issue with connection string.

please suggest for this
Posted 25-Feb-13 5:06am
Updated 25-Feb-13 9:06am
Tharaka MTR 25-Feb-13 10:24am
please provide the complete code sample
ali khanna 27-Feb-13 9:40am
the code is like
<pre lang="c#">
object rowsAffected = null
object missing = Type.Missing;
command.ActiveConnection = "";
command.CommandText = "Insert into table query**";
command.CommandType = CommandTypeEnum.adCmdText;
command.Execute(out rowsAffected, ref missing, (int)ExecuteOptionEnum.adExecuteNoRecords)
Abhinav S 25-Feb-13 10:38am
Your update query is working?
ali khanna 27-Feb-13 9:26am
yes the insert query is executed well in database .. when go through code runs without error but no updation in Database

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100