Database Naming Convention

 

For table identity column generally use ID not <TableName>ID unless it is clear what an identity column should be e.g. WO for Work Order
My preference is ID not <TableName>ID because:

  1. Less verbose. If table name itself is long then using <TableName>ID will be wordy and is likely to extend the number of lines in any Transact SQL
  2. ID works
  3. In code you know that the ID column should exist

New PC

Why?
Previous XP desktop had a grinding hard disk and was becoming quite slow. As I do a lot of work on these and do this as self-employed earnings it did not make business sense. For a time I have been using laptop linked to desktop keyboard, mouse, monitor for speed. However have lost multi-monitor. Also concerned that old PC may just fail at some time. Wanted to get a new pc while the old one had some life in it. That way the old one may with less use have years of back-up, or other use. I may at some point change the hard-drive on the old PC, moving all files may be hard work especially as I would want to filter out all the rubbish that is possibly part of the problem with the old PC.

Specifications.
Did upgrade a few times. Novatech IRush Pro. Because:

  • Comes with a graphics card which supports upto 5 monitors. May/likely to want to try 3 monitors as 2 monitors has had a good improvement, but with Visual Studio, SSMS, email, office need more monitors. Also VS has some many docked tools that these may be put on another screen.
  • Fast 3.3 Ghs quad core processor
  • Windows 7 Pro very useful
  • Like service from Novatech
  • Much better value for money c.f. PC world or even Smart Computers
  • They will deliver without windows or junk on the PC. E.g. unwanted McAffee and other services which inevitably slow down a computer. I can add these later if I choose
  • I was told that the more expensive upgrade was quieter. Not convinced.

Verdict

Seems fast. Slightly noisey fan.
Could I possibly have got away with changing the disks on my old PC and leaving it at that. Possibly, but sooner or later other parts would have gone. Like a car it would have been like how much do you spend. The old PC has paid it’s way. Maybe it can still have a life as backup – test agent or some hardware to test things on. Room for storing it is a little issue. Here’s a weird idea. Could I keep it upstairs in my cupboard with plug downstairs, and run it from there.

For setup of disks see
 https://steveshakespeare.wordpress.com/2010/06/25/windows-7-partition-using-windows-disk-management/

 

 

Crystal Reports specified DSN contains an architecture mismatch between the Driver and Application

Database error: MicrosoftODBC Driver Manager The specified DSN contains an architecture mismatch between the Driver and Application. (IES 10901) (WIS 10901)

On Windows 7 there are two ODBC. Probably want the first of these:
C:\Windows\SysWOW64 use against 32 bit data
C:\Windows\System32

However this could be mis-leading, as was the case this morning. It could be that a DSN is missing. Or perhaps missing from the correct ODBC.

SOLID Principles

 

http://www.blackwasp.co.uk/SOLIDPrinciples.aspx

My current design has /architecture is putting DAL in same layer/project/assembly as domain model, by which I mean classes

How to use windows api in VB.Net


'Imports System.Runtime.InteropServices

'Public Class aClass
' Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
' End Function
' Private Shared Function SetForegroundWindow(ByVal hWnd As IntPtr) As Boolean
' End Function
'End Class

How to Open a Process and Send Keys to that Process ( e.g. MS Word )

Following works fine opens document, ctrl + g = go to in word, book mark “StockControl”

Dim process1 As New Process
process1.StartInfo.FileName = String.Concat(My.Settings.DocumentationDirectory, My.Settings.HelpWordFile)
process1.Start()
process1.WaitForInputIdle()
'Dim hwnd = process.MainWindowHandle
Threading.Thread.Sleep(1000)
SendKeys.Send("^g")
SendKeys.Send("+{TAB}")
SendKeys.Send("b")
SendKeys.Send("{TAB}")
SendKeys.Send("StockControl")
SendKeys.Send("{ENTER}")
SendKeys.Send("{ESC}")

Terminal Server – Pros and Cons – Also Remote Desktop Connection

Terminal Server has some pros-some cons.

Advantages

  • Set one machine up. Works for all
  • Reduced hard-ware costs
  • Remote SQL login

Disadvantages

  • Multi-monitor support *1
  • Seems slow on graphics
  • Remote SQL login does not have intelli-sense

*1 Multi-monitor support for Remote Desktop connection

SplitView http://www.splitview.com/

Also from a cmd prompt use mstsc /span will allow a span. But both monitors need to be the same resolution and horizontal. Does work.

How to set resolution for Remote Desktop Connection when you are using 2 monitors

When switching a RDC from the primary to a smaller second monitor the smaller monitor normally has scroll bars on it to get from the bottom taskbar to the window header bar, quite annoying. SOLVED 15-Jan-2012: Change both monitors to use the highest common resolution.

 

 

SSRS Configuration – “user … does not have required permissions. Verify that .. and … UAC …

SOLVED

User ‘<server>\<username>’ does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed.

“To get this resolved you need to start you Internet Explorer as Administrator -> Run as Administrator then open the url http://<Server name>/Reports this will take you to the “SQL Server Reporting Services” Home page
Click on the “Folder Settings” button.
Click on the “New Role Assignment” button.
Add the Group or user name: DOMAIN\USER_NAME, and permissions you have logged in as.
Click on Ok button.
This should resolve the issue.”

VS TFS Build

SQL Linked server – Change of password

TODO confirm this works then mark as Solved

A linked server using VFPOLEDB has worked for sometime here. Then the server related user password was changed and it all stopped working. Perhaps consider following page

http://msdn.microsoft.com/en-us/library/ms175537.aspx

“Linked server login mappings can be added by using sp_addlinkedsrvlogin and removed by using sp_droplinkedsrvlogin. A linked server login mapping establishes a remote login and remote password for a specified linked server and local login. When SQL Server connects to a linked server to execute a distributed query or a stored procedure, SQL Server looks for any login mappings for the current login that is executing the query or the procedure. If there is a login mapping, SQL Server sends the corresponding remote login and password when it connects to the linked server.”