[Mono-list] Problems with ado.net

T Senganal tsenganal at novell.com
Sat Jan 21 01:28:24 EST 2006


Hi 

You need to explicitly set the Update/Insert/Delete Command for performing updates to the database using the dataset..
Instead u can auto-generate the Update/Insert/Delete Commands from a Select Command, by using a CommandBuilder .. 

add this after creating the adapter object: 
NpgsqlCommandBuilder builder = new NpgsqlCommandBuilder (adapter);

and then, u can use the DataAdapter for update etc.. 

Regards
Senga

>>> Arx Henrique <arxcruz at gmail.com> 1/21/2006 12:15:52 am >>>
Hi all,

I've try to execute a SWF program with ado.net. the program compile
fine, and execute fine too, but when i click on button to update or
create a new row, throw this exception:

Unhandled Exception: System.InvalidOperationException: Auto SQL
generation during Insert requires a valid SelectCommand.
in <0x0097f> System.Data.Common.DbDataAdapter:Update
(System.Data.DataRow[] dataRows, System.Data.Common.DataTableMapping
tableMapping)

i believe that's not problem with swf but there's problem with ado.net
or my code is wrong

my version of mono is:

arx at bakunin:~$ mono --version
Mono JIT compiler version 1.1.13.1, (C) 2002-2005 Novell, Inc and
Contributors. www.mono-project.com 
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : normal

using debian unstable.

the code is attached

Cheers

Arx Cruz

--
"A fé remove montanhas, mas eu prefiro a dinamite"



More information about the Mono-list mailing list