views:

287

answers:

1

I downloaded today Subsonic 3 and tried out the examples. I am having a problem with the SimpleRepository example and I wondered if anyone else has had this. In the HomeController there is a defintion as follows:

 public HomeController() {
            _repo = new SimpleRepository("Blog");
        }

I wanted to enable the migrations and so changed it to this:

 public HomeController() {
            _repo = new SimpleRepository("Blog", SimpleRepositoryOptions.RunMigrations);
        }

However, when this runs it causes an error - stating an issue "String or binary data would be truncated.".

If it makes a difference, the version of VS is 2008 (with the GDR applied)

This is still an issue in the latest 3.0.0.1 and .2 downloads..

A: 

You get this error message if the migration you are trying to run would edit/truncate data in your database.

Do you have sql profiler available? That way you can see the sql statement. If you don't have sql profiler available you will need to download the source and use debug to see the actual sql statement that it is trying to execute.

Espo
I could understand that if I was making any changes to the Model.. but I wasn't. I simply wanted to enable migrations. The two Models remained as is (as supplied by the example). The only difference is my Blog db is on SQL2008 , this works perfectly for selecting data so I would imagine this isnt an issue?.
Coolcoder
Looks like it might be resolved but the version available for download was the previous version (it was cached by GitHub). I will verify later.
Coolcoder
Latest version does not fix this. I have made no changes to the model so I cant see why it is complaining.I tried deleting the db objects to see if it would re-create them but it errored with it could not find the categories object (presumably it tried to query it and it didnt run any migrations).
Coolcoder
Really want to use the new SimpleRepository, I am sure the bugs will be ironed out fairly quickly.
Coolcoder