This project is read-only.

Values not persisting

Mar 29, 2012 at 9:18 PM
Edited Mar 29, 2012 at 10:18 PM

version nhdal


I noticed that after running a script manually to create a datetime column i.e. copying the code from a generated script file and then running the query through sql management studio will crate the datetime column, however, persisting values to the new column has no effect.  No values are written to the column and no error is thrown.  Running the script via the install project creates the new datetime column and everything is fine.

if not exists (select * from syscolumns c inner join sysobjects o on = where = 'FreqDate' and = 'Payments')ALTER TABLE [dbo].[Payments] ADD [FreqDate] [DateTime] NULL 

So what's the problem? just use the the install project to create the new column.  The reason I am having to run the script manually is that my clients data is on a remote server and the installation project will not run against remote servers, it seems.  My clients remote server name is similar to,5214 with a user name and password and it connects fine via sql management studio but the installation project says that it is not a valid connection string.

Now I am stuck, as I write this I have no way of providing an update (new dattime column).  Am I missing something here, I hope so.  I really don't mind being thick as long as I can get this update in.  Your help with this matter would be very much appreciated.

Thank You,


I was just thinking, is there a way of running the installation project at runtime, I could then run the update from the website ?

Mar 30, 2012 at 1:04 AM

The CRUD layer is handled by stored procedures so this is why you have this functionality. If you add a field to the table the insert and update stored procs do not know about it so they do not update the new field. If you wish to update the database manually then look in the install project under the stored procedures\generated\objects folder and find the corresponding file for the table to which you added the field. Just copy all the scripts and run them on the database as well. This will update the CRUD layer. Also you can run the installer on a remote server fine if everything is setup as I have done it numerous times. I notice that you are using a non-standard port but that should not matter if you specify it in the connection string of course. As long as you have the port correct and the firewall on the client and the server do not block it, you should be fine. However just running that script file should do the trick.

Mar 30, 2012 at 4:43 AM

Thank You very much for your response, it worked a charm !

The update is in and this may sound corny but it means a lot to me as this client is an income stream and money is tight.  So, thank you once again.

Have a great Day,