+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / No hyphen allowed in DB Name

No hyphen allowed in DB Name

5 posts, 0 answered
  1. Cori Drew
    Cori Drew avatar
    2 posts
    Registered:
    10 Jul 2009
    15 Aug 2010
    Link to this post
    When going through the web startup, adding a db name with a hyphen (DbHyphenTestSitefinity-v1) returned this error, which I was unable to get out of when hitting the back screen and hitting again (I got the same "DbHyphenTestSitefinity-v1" message after hitting back, removing the hyphen & submitting again. It didn't seem to update the value when I changed the db name this way). Do I have to delete this entire new site & start over to resolve this? Please add regex validation if this will not be fixed (our DB team uses a "-vX" naming convention, so this can be an issue).



    Server Error in '/DbHyphenTest' Application.
    --------------------------------------------------------------------------------

    Incorrect syntax near '-'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Telerik.OpenAccess.RT.sql.SQLException: Incorrect syntax near '-'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

    Stack Trace:

    [SQLException: Incorrect syntax near '-'.]
       Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeUpdate(String sql) +196
       Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.execute(String sql) +5
       OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.ExecuteSqlScript(String script, Connection con, SqlDriver sqlDriver, Boolean noShredder) +279

    [OpenAccessException: SQL exception on 'CREATE DATABASE DbHyphenTestSitefinity-v1' : Incorrect syntax near '-'.]
       Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +4
       Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +14
       OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.throwBuildException(String str, Exception e) +32
       OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.ExecuteSqlScript(String script, Connection con, SqlDriver sqlDriver, Boolean noShredder) +331
       OpenAccessRuntime.DataObjects.tools.ant.DatabaseCreationTask.createDatabase() +1037

    [OpenAccessException: Telerik.OpenAccess.OpenAccessException: SQL exception on 'CREATE DATABASE DbHyphenTestSitefinity-v1' : Incorrect syntax near '-'.]
       Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +4
       Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +14
       OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.throwBuildException(String str, Exception e) +32
       OpenAccessRuntime.DataObjects.tools.ant.DatabaseCreationTask.createDatabase() +1099
       OpenAccessRuntime.DataObjects.tools.ant.DatabaseCreationTask.execute() +5
       Telerik.OpenAccess.RT.OpenAccessSchemaAdapter.CreateDatabase(Boolean checkOnly) +335
       Telerik.OpenAccess.SchemaHandlerImpl.Telerik.OpenAccess.ISchemaHandler.CreateDatabase() +55
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.UpgradeDatabase(Database db) +33
       Telerik.Sitefinity.Data.Metadata.OAMetadataLoader.Init(String connectionName, String connectionConfig, Assembly[] references, CultureInfo[] cultures) +284
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.SetDynamicFields(String connName, XElement config, Assembly[] references, CultureInfo[] cultures, XNamespace xmlns) +581
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.ParseConnectionString(String connectionStringName, String key, Assembly[] references, CultureInfo[] cultures) +2666
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.EstablishConnection(String connName, String key, Assembly[] references, CultureInfo[] cultures) +21co
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.GetDatabase(String connectionStringName, Assembly[]& references, CultureInfo[] cultures, Boolean& requiresReset) +98
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.InitializeProvider(IOpenAccessDataProvider provider, String connectionName) +90
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.InitializeDatabase(DataProviderBase dataProvider, NameValueCollection config) +76
       Telerik.Sitefinity.Data.Decorators.OpenAccessDecorator.Initialize(String providerName, NameValueCollection config, Type managerType) +18
       Telerik.Sitefinity.Data.DataProviderBase.Initialize(String providerName, NameValueCollection config, Type managerType, Boolean initializeDecorator) +728
       Telerik.Sitefinity.Data.DataProviderBase.Initialize(String providerName, NameValueCollection config, Type managerType) +18
       Telerik.Sitefinity.Web.UI.Backend.StartupWizard.CreateInstantProvider(String providerName, String connectionString, ConfigElementDictionary`2 providers) +604
       Telerik.Sitefinity.Web.UI.Backend.StartupWizard.GetRoleProvider() +63
       Telerik.Sitefinity.Web.UI.Backend.AdministratorPane.ValidateMembership() +21
       Telerik.Sitefinity.Web.UI.Backend.AdministratorPane.RaisePostBackEvent(String eventArgument) +45
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +170
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2867

     

    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927



  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Aug 2010
    Link to this post
    Hi Cori Drew,

    Thank you for using our services.

    The problem is that OpenAccess cannot create database with special characters in the db name. However if you first create the database on your SQL server instead of letting Sitefinity handling the creation of the database there will be no problems. We have also have an issue with the db setup screen - it is currently "caching" the input and to clear it you have to close the project manager open it again and click go to administration button again.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Atta
    Atta avatar
    7 posts
    Registered:
    20 Dec 2010
    01 Jul 2011
    Link to this post
    Hi ..
    I have already created my database and have moved it to my production server,
    but why Sitefinity is still trying to create new Db , although Database Config is also done ..

    Please guide ... 
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Jul 2011
    Link to this post
    Hi Atta,

    This could happen if the account that runs your application pools is not added as database user with proper permissions.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Alex
    Alex avatar
    7 posts
    Registered:
    11 Oct 2012
    20 Aug 2013
    Link to this post
    Hi Ivan Dimitrov,

    Can you give me more details, please?
    I'm running in the same issues as others posted to this topic but I cannot figure out why do I get:

    [OpenAccessException: SQL exception on 'CREATE DATABASE Sf-502800-DBName' : Incorrect syntax near '-'.]<br>   OpenAccessRuntime.ExceptionWrapper.Throw() +7<br>   OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.throwBuildException(String str, Exception e) +29<br>   OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.ExecuteSqlStatements(IEnumerable`1 statements, Connection con) +230<br>   OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.ExecuteSqlScript(String script, Connection con, SqlDriver sqlDriver, Boolean noShredder) +120<br>   OpenAccessRuntime.DataObjects.tools.ant.DatabaseCreationTask.createDatabase() +1069

    and the DataConfig.config looks like:

    <add connectionString="data source=MYPC\SQLEXPRESS;UID=sa;PWD=mypassword;initial catalog=Sf_523800_DBName" providerName="System.Data.SqlClient" dbType="MsSql" name="Sitefinity" />

    From where do I get the syntax error if I haven't specified any "-" in connection string?


    Waiting your suggestions :)
5 posts, 0 answered