SSMS stops working while SQL Server still running

Aggh
Laptop Win7 SQL Server 2008 R2 SSMS has worked for a couple of months. Suddenly stopped working. SQL Server was still working becase VS-TFS still present.
Log file lookups on Web search suggested all sorts of possible directions to solve including:
Permissions on Network Service, Reinstall SQL Server performance monitors using unlodctr sqlctr.ini or something
Reinstalling SSMS did not work
Anyway what did work was Restoring back two weeks.

SQL Server Autogrowth settings

 

Do not use default setttings. See
http://support.microsoft.com/kb/315512

You can view the current settings through the database properties in SQL Enterprise Manager (SEM). Or, you can run the following Transact-SQL command:

sp_helpdb [ [ @dbname= ] 'name' ]

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

See

http://www.studiocoast.com.au/knowledgebase/6/aspnet/using-sql-server-instead-of-aspnetdbmdf.aspx

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
    SetConnectionStrings()
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
            ‘MessageBox.Show(Global.BC.My.MySettings.Default.conStrSOP)

End Sub

 

value cannot be null. parameter name objecttype. Handles refer to controls which do not exist

 
 
Form designer will not open
Problem is that some code handles refer to controls that do not exist
Resolve these in the code then it should open.
 
I also found near this time that all of my BindingNavigator controls had been deleted
 

Late Binding e.g. to Office, Excel, Word etc

 
Option Strict Off
‘Early binding would require COM reference to Excel which brings in
‘   Microsoft.Office.Core
‘   Microsoft.Office.Interop.Excel
‘Imports Microsoft.Office.Interop
‘However late binding requires Option Strict Off
 
Public Class cls
    Private Sub CopyClipboardToExcel(Optional ByVal MyNewFileName As String = "")
        ‘Late Binding or distribute reference
        ‘http://msdn.microsoft.com/en-us/library/0tcf61s1.aspx
        Try
            ‘Dim xlApp As Excel.Application
            Dim xlApp As Object = CreateObject("Excel.Application")
            Dim xlBook As Object = xlApp.Workbooks.Add
            Dim xlSheet As Object = xlBook.Worksheets(1)
            xlSheet.Range("A1").Select()
            xlSheet.Paste()
            Call FormatExcelSheet(xlApp)
            ‘xlSheet.Cells(2, 2) = "This is column B row 2"
            xlSheet.Application.Visible = True
            If MyNewFileName <> "" Then
                xlSheet.SaveAs(MyNewFileName)
                ‘ Optionally, you can call xlApp.Quit to close the workbook.
            End If
        Catch ex As Exception
            If IsT1 Then
                Throw New ApplicationException(ex.Message, ex)
            End If
        End Try
    End Sub
End Class