Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:16:49+00:00 2026-05-30T08:16:49+00:00

Our application uses H2Sharp to access a H2 database from C# (Framework v4). Recently

  • 0

Our application uses H2Sharp to access a H2 database from C# (Framework v4). Recently we bumped into the following issue: The following code

H2DataAdapter adapter;
DataTable table;
//initialize values
H2Command updateCommand = new H2Command("UPDATE MYTABLE SET NAME=@NAME, DOUBLECOLUMN=@DOUBLECOLUMN WHERE ID = @ID)", connection);
updateCommand.Parameters.Add(new H2Parameter("@NAME", DbType.String, 100, "NAME"));
updateCommand.Parameters.Add(new H2Parameter("@DOUBLECOLUMN", DbType.Double, 8, "DOUBLECOLUMN"));
updateCommand.Parameters.Add(new H2Parameter("@ID", DbType.StringFixedLength, 50, "ID"));
adapter.UpdateCommand = updateCommand;

leads to a syntax error later on when used in the following form when used under a culture with “,” as the decimal separator instead of “.”:

DataRow row = somehow_get_the_row();
row["NAME"] = "name";
row["DOUBLECOLUMN"] = some_double_with_fractional_part;
adapter.Update(table);

The code works fine if user input is a double without fractional part (i.e. 39 works but 39,5 does not work). I assume 39.5 would also work but the UI does not allow characters that are not included in the CurrentCulture.NumberFormat.NumberDecimalSeparator so it is not possible to enter “.” in this case.

The top of the stack (until our code) is like this:

h2-1.3.160.dll!org.h2.jdbc.JdbcConnection.prepareStatement(string str) + 0x1f4 bytes    
H2Sharp.dll!System.Data.H2.H2Command.CreateStatement() Line 335 + 0x35 bytes
H2Sharp.dll!System.Data.H2.H2Command.EnsureStatment() Line 368 + 0x8 bytes
H2Sharp.dll!System.Data.H2.H2Command.ExecuteNonQuery() Line 438 + 0x8 bytes
System.Data.dll!System.Data.Common.DbDataAdapter.UpdateRowExecute(System.Data.Common.RowUpdatedEventArgs rowUpdatedEvent, System.Data.IDbCommand dataCommand, System.Data.StatementType cmdIndex) + 0x4f bytes  
System.Data.dll!System.Data.Common.DbDataAdapter.Update(System.Data.DataRow[] dataRows, System.Data.Common.DataTableMapping tableMapping) + 0x6bc bytes 
System.Data.dll!System.Data.Common.DbDataAdapter.UpdateFromDataTable(System.Data.DataTable dataTable, System.Data.Common.DataTableMapping tableMapping) + 0x2a bytes    
System.Data.dll!System.Data.Common.DbDataAdapter.Update(System.Data.DataTable dataTable) + 0xb2 bytes   

and the error message is

org.h2.jdbc.JdbcSQLException occurred
Message=Syntax error in SQL statement "UPDATE MYTABLE SET NAME=?, DOUBLECOLUMN=? WHERE ID = ?)"
Source=h2-1.3.160

I assume the “,” from the string representation of double in this culture is breaking the SQL statement.

What would be a proper way to get this work? Should the database table contain columns of type double but arguments passed as strings formatted with an invariant culture? Will H2 do the parsing correctly in this case?

The code is running under Windows 7, x64 and H2 Database is v1.3.160.

Thanks in advance for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:16:50+00:00Added an answer on May 30, 2026 at 8:16 am

    The problem seems to be the ) at the very end of the update statement:

    UPDATE MYTABLE SET NAME=?, DOUBLECOLUMN=? WHERE ID = ?)
    

    should be

    UPDATE MYTABLE SET NAME=?, DOUBLECOLUMN=? WHERE ID = ?
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our application uses H2Sharp to access a H2 database from C# (Framework v4). H2Sharp
We have a requirement from a client to protect the database our application uses,
Our application uses a large product database that is updated once a day. Updates
Our application uses a SQL Server back-end with many stored procedures. Recently, while trying
Our application (sadly) uses an MDB back-end database (I.e. JET engine). One of the
Our application uses an SQLite database file to hold some data in it. The
Our application at work uses the ExtJS (Sencha) framework for the UI. The problem
Our application uses libcurl for HTTP, and we want to get access to Internet
Our application uses the MapMaker class from Google collections, and we're getting the exception
Our application uses POI API (poi-2.5.1.jar) for reading from excel files and to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.