[Mono-dev] Solved: Re: Problem with parameters using Odbc/ADO.NET/Sybase 9.0.2 ASA

Nagappan anagappan at novell.com
Wed Jan 3 04:36:29 EST 2007


Hi,

Could you please send your changes ?

svn diff SqlTest.cs > SqlTest.diff

send SqlTest.diff, to the list

Thanks
Nagappan

Mads Bondo Dydensborg wrote:
> tirsdag 02 januar 2007 18:35 skrev Daniel Morgan:
>   
>> FreeTDS Project is here:
>>     
>
> [...]
>
> Thanks for all your pointers.
>
> Unfortunately, Sybase ASE is not an option for me - while ASA is a must. 
> (Sigh).
>
> It turns out, that it was all my bad. Odbc does not support named parameters, 
> except when calling stored procedures.
>
> So, changing
>     
>     insertCommand.CommandText 
>       = "insert into mono_sql_test ( bit_value, int_value ) values ( 1, 
> @p1 )";
>   
>     OdbcParameterCollection parameters = insertCommand.Parameters;
>   
>     parameters.Add ( "@p1", OdbcType.Int );
>     parameters [ "@p1" ].Value = 42; 
>
> to
>     
>     insertCommand.CommandText 
>       = "insert into mono_sql_test ( bit_value, int_value ) values ( 1, ? )";
>   
>     OdbcParameterCollection parameters = insertCommand.Parameters;
>   
>     parameters.Add ( "int_value", OdbcType.Int );
>     parameters [ "int_value" ].Value = 42; 
>     
> makes it all work.
>
> So, Mono does work with Sybase ASA 9.0.2 using Odbc, as long as one does not 
> try to use named parameters.
>
> I have modified a copy of the SqlTest.cs program to test the various calls. 
> Should I submit this somewhere? (Could perhaps help others along the way).
> Regards,
>
> Mads
>
>   

-- 
Nagappan A <anagappan at novell.com>
Novell Software Development (I) Pvt. Ltd.
Linux Desktop Testing Project - http://ldtp.freedesktop.org
http://nagappanal.blogspot.com/

Novell, Inc.
SUSE® Linux Enterprise 10
Your Linux is ready™
http://www.novell.com/linux




More information about the Mono-devel-list mailing list