[Mono-dev] Odbc-Exception-Error
Rafael Teixeira
monoman at gmail.com
Sat Aug 13 18:52:09 EDT 2005
Hi Jan,
Have you tried to use the direct ADO.NET provider for PostgreSQL
called NPGSQL? It may help you be more productive and has better
performance and portability.
:)
On 8/13/05, Jan Waiz <hamburg at icomedv.de> wrote:
>
>
>
> Hi Folks,
>
>
>
> big Trouble in China! J
>
>
>
> Working with ODBC on a PostgreSQL.
>
>
>
> While the ODBC did not support named Parameters and to be save about Signs
> like the <'> in Textboxes, i am building my Update-Statements like this:
>
>
>
> cStmnt = "UPDATE ComanySTD SET" +
>
> "Name1 = ?,"
>
> "Name2 = ?"
>
> "WHERE PKey = '" + cPKey + '"
>
>
>
> oCommand.Parameters.Add( "@Name1", Textbox_Name1.Text.Trim() )
>
> oCommand.Parameters.Add( "@Name2", Textbox_Name2.Text.Trim() )
>
> oCommand.ExecuteNonQuery()
>
>
>
> This works fine when starting under Localhost.
>
>
>
> If running in Mono I get an Error:
>
> System.Data.Odbc.OdbcException: [unixODBC]Unrecognized C_parameter type in
> copy_statement_with_parameters
>
> When changing the Statement to:
>
>
>
>
> cStmnt = "UPDATE ComanySTD SET" +
>
> "Name1 = " + Textbox_Name1.Text.Trim() + ,"
>
> "Name2 = " + Textbox_Name2.Text.Trim() + ,"
>
> "WHERE PKey = '" + cPKey + '"
>
>
>
> oCommand.ExecuteNonQuery()
>
>
>
> it works with Mono – but if there is an <'> in a Textbox it crashes. So I
> have to escape special Signs manuel.
>
>
>
> I found one Entry in Google, where one Developer will have the same Problem
> – but there wasn´t any Answers what to do.
>
>
>
> Someone here who can help me what I have to do?
>
>
>
> Many Thanks in Advance for any Help !!
>
>
>
> Regards
>
> Jan Waiz
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
--
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes.
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!
More information about the Mono-devel-list
mailing list