SQL Server Shrink – Maintenance

Does not always work straight off bat:

  1. Need to backup both database and transaction log regularly and possibly before shrink
  2. Try shrinking Database
  3. Try shrinking Database File and Transaction Log File
  4. Repeat above sequences until files shrink

There may be something blocking the shrink. Try the following query. Should return NOTHING in the second column.
If LOG_BACKUP then the space may not be released until a log backup is done.

SELECT name,log_reuse_wait_desc FROM sys.databases ORDER BY name


Scrum and Project Management

Requirements – Change Request

TQD as a triangle with an area – generally speaking if one increases then one of the others needs to compensate so that the area stays the same

ASP.Net using network SQL Server instead of SQL Server Express for ASPNETDB.mdf



ASP.Net convert website project to web application project

The way I did it was:

  • Create a new web application project
  • Close project
  • Copy all items from website project folder into new application folder. The olde files should overwrite any duplicate new items
  • Open web application project
  • Show all files to show folders not included in project shaded out
  • Include each folder not already in project. Which will load any items in that folder
  • Select Master Page
  • Right-Click choose convert project to web application project
  • This creates designer.vb files
  • Try now

“Input String was not in the correct format” – on Bindingsource

Check all textbox or other controls with bindings.
Did you set the value of one programmatically to wrong format. E.g. Number binding, but text put in.
Bindingsource row will remain rowstate.detached until resolved.

Changing Settings at Runtime in working project and referenced assemblies (or projects) ( including connection strings )

I like and need this.
Put this in ApplicationEvents

Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
End Sub


Private Sub SetConnectionStrings()

            Dim sConString As New SqlConnectionStringBuilder
            sConString.MultipleActiveResultSets = True
            sConString.IntegratedSecurity = True

            Select Case My.Computer.Name.ToUpper
                Case “Computer1”
                    sConString.DataSource = My.Computer.Name
                Case “Computer2”
                    sConString.DataSource = My.Computer.Name ‘+ “\SQLEXPRESS”
                Case Else
                    sConString.DataSource = “<your server name>”
            End Select

            My.Settings.conStringSettings = New System.Configuration.ConnectionStringSettings
            My.Settings.conStringSettings.ProviderName = System.Data.SqlClient 

            sConString.InitialCatalog = “<your initial catalog>”
            My.Settings.<name of saved system.configuration.connectionstringsettings>.ConnectionString = sConString.ConnectionString
            My.Settings(<name of saved connection setting) = sConString.ConnectionString
            Global.<referenced assembly name>.My.MySettings.Default(“<name of saved connection setting>”) = sConString.ConnectionString

End Sub