AnantLabs / h2sharp

Automatically exported from code.google.com/p/h2sharp
0 stars 0 forks source link

Table TEST not found #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
I am sorry that that this issue which I am facing appeared as defect. Thanks to 
Google who always open new issues as defect.

Original comment by pranesh....@gmail.com on 2 Nov 2009 at 9:33

GoogleCodeExporter commented 9 years ago
I don't know how to update the issue but it is solved at myend. I was doing 
mistakes 
due to which I wasn't able to run the example.

Thanks again

Original comment by pranesh....@gmail.com on 9 Nov 2009 at 3:06