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

Forums / Developing with Sitefinity / Cracy with nolics initialize, force Upgrade

Cracy with nolics initialize, force Upgrade

2 posts, 1 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    22 Sep 2010
    Link to this post
    Hi team,

    After many, many initilialize i not have my updating using nolics. I have used same code many times and sometimes is working and anothers not. I use vs2005 to make using full rights as admin and pointing the nolics class as typeof assembly.I use one project with 3 nolics class for databases. 2 tables are generated not 3. nolics class code is created the code normally backside.No particular code in nolics class only simple table.

    Exist some way to force the Upgrading manually to the server in production mode.

    private static bool Initialized = false;
     
        protected void Page_Load(object sender, EventArgs e)
        {
            InitializeControls();
            //Forcing to create one item
            Transaction transaction = new Transaction();
            Start_Rating_Value item = new Start_Rating_Value();
            OdbClass.Create(item, transaction);
            item.HotelID = 1;
            transaction.Commit();
        }
     
        protected void InitializeControls()
        {
            try
            {
                Assembly VistaEanAssembly = typeof(Start_Rating_Value).Assembly;
                DataConnection.Initialize(false, VistaEanAssembly);
                OdbDataProvider provider = NolicsHelper.SetConnection("DefaultConnection");
                provider.Upgrade();
                Initialized = true;
            }
            catch (Exception ex)
            {
                Response.Write("Error" + ex.Message);
            }
        }

    error in some cases is :ErrorLine 3: Length or precision specification 0 is invalid.===> provider.Upgrade
    [SqlException (0x80131904): Line 3: Length or precision specification 0 is invalid.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1953274
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849707
    

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Sep 2010
    Link to this post
    Hello Pierre,

    You can upgrade projects only in full trust environment. The error you are getting is because there could not be established a connection to your SQL server - you get errors from SqlConnection class. The error you are getting "Length or precision" could be a result of using old [ODBC SQL Server Driver] or you are trying to enter inappropriate data to some columns.

    All the best,
    Ivan Dimitrov
    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
    Answered
2 posts, 1 answered