Обсуждение: BUG #4696: update bug

Поиск
Список
Период
Сортировка

BUG #4696: update bug

От
"carl"
Дата:
The following bug has been logged online:

Bug reference:      4696
Logged by:          carl
Email address:      carl@multimax.co.za
PostgreSQL version: 8.3.6
Operating system:   windows
Description:        update bug
Details:

Hi, I'm running asp.net 3.5 and Npgsql.dll 2.0.4.0

When running the following code, a number representing the number of
effected rows is returned, but the database entries have not been changed.

The following is written in c# code.

Please could you help me, as I've been struggling with this issue for over a
month now, and cannot figure out why it's not working...

=============
Code Snippet
=============
NpgsqlConnection L_Conn = Get_PostgresConnection(SystemCode);

DataSet ds = new DataSet();
NpgsqlDataAdapter da = new NpgsqlDataAdapter(Qry, L_Conn);

da.Fill(ds);

ds.Tables[0].Rows[0]["sys_code"] = "try";

DataSet ds2 = ds.GetChanges();

NpgsqlCommandBuilder L_CmndBuilder = new NpgsqlCommandBuilder(da);

return da.Update(ds2);

(returns 1 as it should)

Re: BUG #4696: update bug

От
toruvinn
Дата:
On Fri, 06 Mar 2009 14:25:44 +0100, carl <carl@multimax.co.za> wrote:
> When running the following code, a number representing the number of
> effected rows is returned, but the database entries have not been
> changed.
Just a quick idea: aren't you running that in a transaction which is ROLLED BACK at the end (this also happens when you
neitherrollback/commit the transaction, it's rolled back when the client disconnects). Try commiting it. 

--
ru