Re: Oracle ADO query shows deleted records
From: Jerry Pisk (jerryiii_at_hotmail.com)
Date: 08/26/04
- Previous message: Steve W: "Re: Oracle ADO query shows deleted records"
- In reply to: Steve W: "Re: Oracle ADO query shows deleted records"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Aug 2004 08:01:40 -0700
The code looks ok, as long as you're closing the connections (which would
cause its own problems but not this). The only thing I can think of is to do
a little debugging, capture and printout the value returned by
ExecuteNonQuery on the delete command, it returns the number of rows
affected by that command.
Jerry
"Steve W" <BunnyBoy@community.nospam> wrote in message
news:O$wNsW1iEHA.3928@TK2MSFTNGP11.phx.gbl...
> Apologies - having re-read my original message I quite agree !
>
> Let me try again : I construct a sql delete statement and fire it an
> Oracle
> database via the following type of code :
>
> Dim moUpdateCon As Object
> Dim oCmd As Object
> moUpdateCon = New OracleClient.OracleConnection
> moUpdateCon.ConnectionString = sConStr
> moUpdateCon.Open()
> oCmd = New OracleClient.OracleCommand
> oCmd.Connection = moUpdateCon
> oCmd.CommandText = "DELETE FROM Table Where Column = 1"
> oCmd.ExecuteNonQuery()
>
> This is done via a request to a web page. Then via a request from another
> web page by the same user, I use an OracleClient.OracleDataReader to
> read data from the table via :
>
> Dim oOracleDR As OracleClient.OracleDataReader
> Dim oCommand As OracleClient.OracleCommand
>
> oCommand = New OracleClient.OracleCommand("SELECT * FROM Table Where
> Column = 1", New OracleClient.OracleConnection(sConStr))
> oCommand.Connection.Open()
> oOracleDR = oCommand.ExecuteReader(CommandBehavior.CloseConnection)
>
> This always returns the deleted row (there are no other rows in the
> table).
>
> I hope that's clearer and that someone can suggest where I'm gpoing wrong
> !
>
> Thanks
>
> Steve
>
> "Jerry Pisk" <jerryiii@hotmail.com> wrote in message
> news:eqHc4MjiEHA.384@TK2MSFTNGP10.phx.gbl...
>> You need to be a little more specific. "Delete a record from a table" is
>> such a vague statement that you will probably not get any response to it.
>>
>> The short answer is no, ADO doesn't cache anything. The long answer is
> yes,
>> it does cache records. It all depends on what you're doing.
>>
>> Jerry
>>
>> "Steve W" <BunnyBoy@community.nospam> wrote in message
>> news:uG6sT$fiEHA.1348@tk2msftngp13.phx.gbl...
>> > From an ASP.NET application (or a .Net component called by an ASP.NET
>> > application) I connect to Oracle via ADO and delete a record from a
> table.
>> >
>> > If I look via Oracle's SQL plus the record has gone.
>> >
>> > If I then query the table, the row still seems to be there. Is ADO
>> > caching
>> > this data somehow ?
>> >
>> > Thanks
>> >
>> > Steve
>> >
>> >
>>
>>
>
>
>
- Previous message: Steve W: "Re: Oracle ADO query shows deleted records"
- In reply to: Steve W: "Re: Oracle ADO query shows deleted records"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|