SSMS 2008 R2 is losing Intellisense after installing Visual Studio 2010 SP1

http://connect.microsoft.com/SQLServer/feedback/details/650569/ssms-2008-r2-is-losing-intellisense-after-installing-visual-studio-2010-sp1

Apply cumulative update to SQL Server 2008 R2

http://support.microsoft.com/kb/981356

 

SQL Server PowerPivot

Installation seemed easy enough – If Excel 2010 32-bit edition as you should, then need 32-bit x86 version of PowerPivot

Import

If a table has a timestamp (binary) data then exclude that otherwise you get an error

Group by date

So far this has been disabled for me

How do I … Import more tables using an Existing Connection

At first glance “Home” tab, section “Get External Data” is the only place to get new tables from. However it is not possible to use an existing connection from here, so I landed up with several connections 1,2,3 to the same SQL Server. To add a new import to an existing connection:

Design tab > Existing Connections > Open or Double click the connection you want to get a new import from

How do I … Refresh after a Schema Change

Design Tab > Table Properties
Use Switch to “Table Preview” or “Query Editor” to validate

Insert Pivot Chart

This puts the Data for Sheet 1 Chart 1 on a different tab.
To move it to the same tab as the chart use “PivotTable Tools” > Move PivotTable

Trouble Shoot every sum as same number – no apparent grouping

I had WO -> Reject Card on WO -> Reject Detail on WO
I found this created no proper grouping, so sum was same number for every group. Changed to:
WO – > Reject Card
and
WO -> Reject Detail
Problem solved

Sort by Date workaround

Sorting by date does not work, to workaround this create a Computed/Calculated column and use this:
= Year([WorkOrder!CompletionDate) * 100 + Month([WorkOrder]![CompletionDate]
YearMonth = Date(Year([WorkOrder!CompletionDate), Month([WorkOrder]![CompletionDate], 1)
YearMonthSort = Format(YearMonth, “yyyy-mm”)

 

Error 1

“Could not add the field “<field>” to the PivotTable.  Please ensure the field exists and is calculated, and try refreshing the PivotTable.”

Solution 1

Close the file and then open it again

 

Possible improvements for Microsoft

  1. If an import fails you should be able to go back to the previous step, rather than having to start again
  2. On Diagram View good to have zoom, but why is minimum 100 %
  3. The table import wizard should be resizable
  4. Make sort by date work

Microsoft Visual Studio LightSwitch – Installation

There is a lot of web talk on problems with existing SQL installations before installing LightSwitch

  1. LightSwitch 2011 requires SQL Server Express to be installed. It is looking for SQLEXPRES instance.
  2. If you already have SQL Developer edition you may have a problem. I tried to trick it by adding an instance to SQL Developer named SQLEXPRESS. This got past the LightSwitch install.
  3. However still could not use the program because it also requires User Instances, which are not possible in Developer. So Removed my SQLEXPRESS instance. To do this > Programs and Features > Microsoft SQL Server 2008 R2 (64-bit) then Remove. Don’t panic it asks if you want to uninstall an instance, so you can leave previous instances on there.
  4. Then installed SQLExpress side-by-side with my developer edition. All OK
  5. LightSwitch 2011 good to go!

Reading Command line arguments in VB.NET

Nice clear entry at:

http://forum.codecall.net/visual-basic-tutorials/16661-reading-command-line-arguments-visual-basic-net.html

In Project > My Project > Publish > Options > Deployment
Uncheck “Use “.deploy” file extension

Now after publishing you will get the .exe file. If you create a shortcut to this .exe file you can add command line arguments to it as shown in the image below:

 Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs

 

For i As Integer = 0 To CommandLineArgs.Count - 1
     MessageBox.Show(CommandLineArgs(i))
Next

There maybe reasons why you may not want to uncheck this. Namely:

http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(MICROSOFT.VISUALSTUDIO.PUBLISH.CLICKONCEPROVIDER.DIALOG.OPTIONS);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22)&rd=true

 

VS Bug on FormClosing datagridviewcomboboxcell value is not valid

Error message may be “Field called xxx does not exist”

Try this on Form closing

Private Sub frm_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    Me.MyGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None
End Sub

I would hazard to suggest thatVisual Studio does not dispose of the datagridview in the correct sequence

This sometimes occurs when my personal code > SetUpDataGridView may programmatically set the AutoSizeRowsMode.

—–

This link http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/88c3adee-ed2a-41ee-9407-c3314588e08a/
Suggests it may be something to do with autosize, when there is a combobox created. The order of creation and setting may be important.

“If you autosize the column but have not provided the combo box column with a valid datasource or you haven’t yet added items to the combo box column’s items collection then you’ll get this error at startup because autosizing requires the cell’s FormattedValue to be requested. Requesting the FormattedValue of a combo box cell is where the check is done that may raise the data error exception you are seeing.

Set the autosize mode after you fill the combo box and things should be ok.

Mark Rideout – DataGridView Program Manager – Microsoft”

Or create the comboboxcolumn then clear the autosize modes > run > re-set the autosize mode.
Or programattically set the autosize after form has designer InitialiseComponent code has loaded.

Roaming and Outlook Email – Leave a copy of messages on the server

While I have accessed email from Outlook on my PC for years, I recently discovered that I could access my email from the web and this left a copy of the message on the server, so when I next used Outlook the message would be shown there as well. However as soon as it is received in Outlook it is no longer visible on the server.

My friend indicated that there was a method of leaving messages on the server. This is here:

  1. Tools >Email Accounts > View or change existing e-mail accounts > Next
  2. Select Account > Change > More Settings … > Advanced
  3. Delivery > Leave a copy of messages on the server
    • Remove from server after ( and I have currently chosen 10 ) days
    • Remove from server when deleted from ‘Deleted Items’ – I have chosen checked

New PC – Novatech AMD Radeon 6770 HD Graphics Card – Settings

After setting up new PC was initially having problems with the graphics card. (Novatech) AMD Radeon 6770.
Key: Catalyst Control Center = CCC

Did uninstall the driver and CCC at one point and re-install everything, from Downloads\Graphics folder. Seemed to work well for half an hour – now seems a little less than perfect. Will see.  So turned off PC rest then turn back on and graphics good again. However with HDMI to Iiyama I now have a buzz. Have used the monitor setting to mute the sound and it has gone away. May need to use DVI on Iiyama as well.
The configurations which temporarily worked are:

  • Main Monitor is IIyama ProLite E2607WS – Use HDMI
    • CCC > Desktop Management > 1920 x 1200 + 60 Hz  (recommended)
    • CCC > My Digital Flat-Panels > Properties >
      •  Image Scaling > Enable GPU Scaling = True
      • Enable ITC processing = True
  • LHS Acer AL2021 use DVI
  • RHS Dell 2005FPW Portrait 1050 x 1680 (recommended) may be a desk saver that way around
    • Using Sapphire Active Display Port to Single-Link DVI Adapter

Update 1-Sep-2011
Still having problems. So after talking with Technical Support at Novatech I have took the graphics card out – and put back in – reseat in the computer. This seems to have increased the proportion of time that the machine is OK. Still not 100% though

How do I … join a network domain using windows

To login to a work network

  1. Start > Computer > Right-click > Properties
  2. Change Settings > First tab is Computer Name > Bottom button is Change >
  3. Member of – select toggle button on Domain > Enter Name of Domain > Need to login to that domain > may need to restart

Once you have joined the domain you can use explorer address bar to type \\ <domain name> \ shared directory path

To login back in to home

  1. Start > Computer > Right-click > Properties
  2. Change Settings > First tab is Computer Name > Bottom button is Change >
  3. Member of – select Workgroup > normal name is “WORKGROUP”

Dataset Designer: Unable to find connection MyConn (MySettings)1 for object ‘MySettings’

 

Solved:
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/08a48cad-619d-4421-b584-f2b5550ba6c5

Solution from Don,
“I had the same problem with one of my projects. If you open up the Dataset using the XML editor you should see a line near the top that looks like this:

<DataSourceDefaultConnectionIndex=1FunctionsComponentName=QueriesTableAdapterModifier=AutoLayout, AnsiClass, Class, PublicSchemaSerializationMode=IncludeSchemaxmlns=urn:schemas-microsoft-com:xml-msdatasource>

I changed the DefaultConnection Index from a 1 to a 0 and the problem went away. I suspect at one time I had two connections and one went away but the index was not updated.

<DataSourceDefaultConnectionIndex=0FunctionsComponentName=QueriesTableAdapterModifier=AutoLayout, AnsiClass, Class, PublicSchemaSerializationMode=IncludeSchemaxmlns=urn:schemas-microsoft-com:xml-msdatasource>”

Also other posts here may be useful:
In my particular case had too many connection strings and deleted one of them.

 

SQL Server backup notes

Back Up Database Task

Several points of issue with this routine. It is not as obvious as it may seem:

  • Backup set will expire After n days or On a date – when using a backup device
    • Although the backup expires it does automatically get overriden and space released. It stays there so the backup device will continue to grow and potentially fill-up the disk. Disappointing.
  • If backup file exist: Append or Overwrite.
    • Append is clear. Overwrite is not so clear. As far as I can tell it will clear out any-all existing backups in the device. As opposed to clearing out expired backups.

For a long time I had not used the backup set expire. I have been using the expire for about 3 months with 100 days. I was expecting it to start clearing out the old backups, so keeping the backup device file size roughly static. However this did not happen and the disk started to fill up.

So in conclusion I will revert to my previous method of renaming the backup device with a date on the end yyyy-mm-dd which means the backup task then recreates it. Then after a period of time move the old backup devices off to a separate NSA drive.

Grandfather – Father – Son
Now do backups several times a day, but now also do a monthly backup with the intention of eventually deleting daily backups.