nsabiyera / Oak

Frictionless development for ASP.NET MVC single page web apps. Prototypical and dynamic capabilities brought to C#.
http://amirrajan.github.com/Oak
MIT License
6 stars 7 forks source link

System.Data.SqlServerCe.SqlCeException (0x80004005): The specified table does not exist. [ sysobjects ] after changing to SQL Server Compact #30

Closed davidpodhola closed 7 years ago

davidpodhola commented 10 years ago

If I change Web.Config, Query.cs and Massive.cs to connect to SQL Server Compact (connection string in Web.config, Sql* classes to SqlCe* classes and _providerName = "System.Data.SqlServerCe.4.0" in Massive), I get The specified table does not exist. [ sysobjects ]

at Oak.Query.ExecuteReader(String query, ConnectionProfile connectionProfile) in c:\Users\david.podhola\Documents\Visual Studio 2012\Projects\Blog\Blog\Oak\Q uery.cs:line 46 at Oak.Seed.DropAllForeignKeys() in c:\Users\david.podhola\Documents\Visual S tudio 2012\Projects\Blog\Blog\Oak\Seed.cs:line 185 at Oak.Seed.PurgeDb() in c:\Users\david.podhola\Documents\Visual Studio 2012\ Projects\Blog\Blog\Oak\Seed.cs:line 142

after running "rake sample"

Probably should be change according to http://support.microsoft.com/kb/272210

amirrajan commented 10 years ago

Here is a write up of how to get Oak building and running. It's an inital draft, so please let me know if you hit any snags:

https://github.com/amirrajan/Oak/wiki/Contributing-to-Oak

Here are a list of touch points where sysobjects and syscolumns is used.

Oak/Association.cs
1031:    .Query("select name from sysobjects where name = @0", table)
Oak/Seed.cs
189:    from sysobjects where xtype = 'f'".ExecuteReader(ConnectionProfile);
203:    from sysobjects where xtype = 'pk'".ExecuteReader(ConnectionProfile);
216:    from sysobjects where xtype = 'u'".ExecuteReader(ConnectionProfile);
Oak/Association.cs
1014:  .Query("select name from syscolumns where id = object_id(@0)", table)

If the following tests run without a hitch, I think we'll be in good shape.

What are your thoughts on running all of the Oak test suite with SQLCE? (I wonder if I'm using any features that would cause Oak to fail). If you want to attempt that, you'll have to look at the following touch points.

Oak.Tests/describe_DynamicRepository/executing_procs.cs
24:     "if exists(select * from sysobjects where name = 'GetRecords' and xtype = 'p')
Oak.Tests/describe_Seed/_seed.cs
42:     return "select * from sysobjects where name = '{0}'".With(table).ExecuteReader().HasRows;
Oak.Tests/describe_Seed/_seed.cs
52:     var reader = "select name from syscolumns where object_name(id) = '{0}';".With(table).ExecuteReader();
Oak.Tests/describe_DynamicRepository/inserting_and_updating.cs
Test starting on line 79: void updating_every_type_of_sql_column()
davidpodhola commented 10 years ago

Thanks. When going through the https://github.com/amirrajan/Oak/wiki/Contributing-to-Oak, I was unable to clone the repository and also got test failure:

\ FAILURES **

nspec. describe DynamicToJson. serialization of self reference objects. describ e db rows to json. disregards self referencing objects. Expected string length 1747 but was 1721. Strings differ at index 85., Expected: "..., "rabbitId": 1, "dueDate": "1/14/2013 12:00:00 AM", "rabb...", But was: ". .., "rabbitId": 1, "dueDate": "14/01/2013 00:00:00", "rabbit...", -------------- ------------------------------^ at Oak.Tests.describe_DynamicToJson.serialization_of_self_reference_objects.< describe_db_rows_to_json>b__36() in c:\Users\david.podhola\Documents\GitHub\Oak\ Oak.Tests\describe_DynamicToJson\serialization_of_self_reference_objects.cs:line 175

673 Examples, 1 Failed, 1 Pending

Probably not big deal anyway. Will add more info when SQL CE tests are run :-)

amirrajan commented 10 years ago

That looks like a regionalization issue. It should be fine.

On Mon, Sep 2, 2013 at 9:00 AM, David Podhola notifications@github.comwrote:

Thanks. When going through the https://github.com/amirrajan/Oak/wiki/Contributing-to-Oak, I was unable to clone the repository and also got test failure:

\ FAILURES **

nspec. describe DynamicToJson. serialization of self reference objects. describ e db rows to json. disregards self referencing objects. Expected string length 1747 but was 1721. Strings differ at index 85., Expected: "..., "rabbitId": 1, "dueDate": "1/14/2013 12:00:00 AM", "rabb...", But was: ".

.., "rabbitId": 1, "dueDate": "14/01/2013 00:00:00", "rabbit...",

------------------------------^ at Oak.Tests.describe_DynamicToJson.serialization_of_self_reference_objects.< describe_db_rows_to_json>b__36() in c:\Users\david.podhola\Documents\GitHub\Oak\

Oak.Tests\describe_DynamicToJson\serialization_of_self_reference_objects.cs:line 175

673 Examples, 1 Failed, 1 Pending

Probably not big deal anyway. Will add more info when SQL CE tests are run :-)

— Reply to this email directly or view it on GitHubhttps://github.com/amirrajan/Oak/issues/30#issuecomment-23661826 .

davidpodhola commented 10 years ago

Fine. If you want to look into the work-in-progress, please check https://github.com/davidpodhola/Oak/commit/a777e355094aa640305c74f114d0560e4708208b . Please note there are no checks yet, this would work with SQL CE ONLY. Do you have an idea how SQL/SQLCE switch should be done? By checking the provider in connectionString?

amirrajan commented 10 years ago

Here is how I'm doing it in my Postgres branch, points of interest:

https://github.com/amirrajan/Oak/blob/pg/Oak/Seed.cs#L432 https://github.com/amirrajan/Oak/blob/pg/Oak/Seed.cs#L422 https://github.com/amirrajan/Oak/blob/pg/Oak/Seed.cs#L217

On Mon, Sep 2, 2013 at 10:23 AM, David Podhola notifications@github.comwrote:

Fine. If you want to look into the work-in-progress, please check davidpodhola@a777e35https://github.com/davidpodhola/Oak/commit/a777e355094aa640305c74f114d0560e4708208b. Please note there are no checks yet, this would work with SQL CE ONLY. Do you have an idea how SQL/SQLCE switch should be done? By checking the provider in connectionString?

— Reply to this email directly or view it on GitHubhttps://github.com/amirrajan/Oak/issues/30#issuecomment-23666162 .

davidpodhola commented 10 years ago

I see. Except for SCHEMA (not supported on SQL CE), I have tests running. Maybe I should wait for the postgres branch to be merged back?

BTW in one of our recent project we will like to use Oak on postgres :-)

amirrajan commented 10 years ago

It'll be a while before the Postgres branch is merged back in. Probably best not to wait on it. Here is the commit I'm currently working on. https://github.com/amirrajan/Oak/issues/31

Sent from my iPhone

On Sep 3, 2013, at 4:04 AM, David Podhola notifications@github.com wrote:

I see. Except for SCHEMA (not supported on SQL CE), I have tests running. Maybe I should wait for the postgres branch to be merged back?

BTW in one of our recent project we will like to use Oak on postgres :-)

— Reply to this email directly or view it on GitHub.

davidpodhola commented 10 years ago

I see. Well, it seems however that I am basically copying the code you have in your Postgres branch as there are almost identical changes needed even in SQL syntax. Maybe better wait...? We can test the Postgres in meantime, if you are interested.

amirrajan commented 10 years ago

Hmm. I will concentrate on information schema related changes for now, and merge those back into master. If there is anything you can contribute to the pg branch (something that I missed for Sql CE), that would help. I'm fine either way though, I don't mind getting a pull request on master for SQLCE and then working through any merge conflicts/variances back to my PG branch.

On Tue, Sep 3, 2013 at 10:13 AM, David Podhola notifications@github.comwrote:

I see. Well, it seems however that I am basically copying the code you have in your Postgres branch as there are almost identical changes needed even in SQL syntax. Maybe better wait...? We can test the Postgres in meantime, if you are interested.

— Reply to this email directly or view it on GitHubhttps://github.com/amirrajan/Oak/issues/30#issuecomment-23720121 .

amirrajan commented 7 years ago

will not fix