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 386909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:37:19+00:00 2026-05-12T15:37:19+00:00

I am trying out SubSonic to see if it is viable to use on

  • 0

I am trying out SubSonic to see if it is viable to use on production projects. I seem to have stumbled upon an issue whith regards to updating the database with default values (String and DateTime) when a new column is created.

If a new property of DateTime or String is added to an object.

public class Bug
{
    public int BugId { get; set; }
    public string Title { get; set; }
    public string Overview { get; set; }
    public DateTime TrackedDate { get; set; }
    public DateTime RemovedDate { get; set; }
}

When the code to add that type of object to the database is run

var repository = new SimpleRepository(SimpleRepositoryOptions.RunMigrations);           

repository.Add(new Bug()
{
    Title = "A Bug",
    Overview = "An Overview",
    TrackedDate = DateTime.Now
});

it creates the following sql:

UPDATE Bugs SET RemovedDate=''01/01/1900 00:00:00''

For some reason it is adding double 2 single quotes to each end of the string or DateTime.

This is causing the following error:

System.Data.SqlClient.SqlException – Incorrect syntax near ’01’

I am connecting to SQL Server 2005

Any help would be appreicated as apart from this issue i am finding SubSonic to be a great product.


I have created a screen cast of my error here:

  • 1 1 Answer
  • 1 View
  • 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-12T15:37:20+00:00Added an answer on May 12, 2026 at 3:37 pm

    It is a bug and the dual quotes was introduced a few revs back. I’m fairly certain this has been fixed > 3.0.0.3 so if you want to grab the current drop it should be dealt with.

    Sorry for the confusion – but as you have found out you can set the value on create and this will sort the problem. In addition you can do what andymeadows suggests and this will make the field nullable (which is probably more accurate).

    Anyway – we’ll have this fixed soon :). I’m trying to find a job and don’t have too many cycles to spend merging branches 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying out zsh as an alternative to bash, and I seem to have
I was trying out the url template tag and stumbled on a issue: Caught
Trying out filters for replication, I stumbled upon a problem. While my filter is
I am trying out some examples with analytical functions and i have created a
trying out upgrading antlr4, I have 2 lines in the grammar that produce the
I'm trying to figure out how to use lxml to parse the xml from
I have been trying out the CTP Beta 1 of Visual Studio 2010 and
Trying out VS 2010, but still want to target .NET 3.5. Have all my
Im trying out an example with EJB Session Beans. I wanna see the differences
I have been trying out some different ways to organize my code in my

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.