Skip to content

Table TEST not found #4

Description

@GoogleCodeExporter

I created a small console project in C# and used the same code which you 
gave in your example. Before that I created table TEST in default database 
test (connection url is jdbc:h2:~/test) using H2 console and disconnected 
this session.
the main function of my program is below which, on execution, throws a 
exception that table TEST not found.
static void Main(string[] args)
        {
            using (H2Connection connection = new H2Connection
("jdbc:h2:~/test;", "sa", "")) 
            { 
                connection.Open(); 
                using (H2Command command = connection.CreateCommand()) 
                { 
                    command.CommandText = "Select * from TEST";
                    H2DataReader reader = command.ExecuteReader();
                    while (reader.Read())
                    {
                        Console.WriteLine(reader["NAME"]);
                    }
                    reader.Close();
                }
            }
        }

I am not whether it is due to H2Sharp or H2 database itself has some issue.
I create a table using the following SQL statements.
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255));
INSERT INTO TEST VALUES(1, 'Hello');
INSERT INTO TEST VALUES(2, 'World');

Thanks

Original issue reported on code.google.com by pranesh....@gmail.com on 2 Nov 2009 at 9:32

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions