ASP.Net style css etc.

How to change width of out of box Visual Studio ASP.Net WebForms application

Took a while to work this out. In the Site.Master there is:

<form runat="server">
<div class="page">...

If you go to the class=”page” definition on the Site.css you may see a width. This seems to have no effect. I do not know why.

  1. Instead use split view and see on the bottom the different selections e.g.
  2. then with properties showing select
  3. then use the style property
  4. potion
  5. width e.g. 90 %

This may also be achieved in the source on the div tag:

<div class=”page” style=”width: 90%”>



Failed to connect to a windows service – Group Policy Client

Error on start-up of windows:

“Failed to connect to a windows service
Windows could not connect to the Group Policy Client service. This problem prevents standard users from logging on to the system.
As an administrative user, you can review the System Event Log for details about why the service didn’t respond”

Group Policy on login 2013-01-10

This also does not start a service:

Group Policy Service Not started 2013-06-12


Resolved with thanks to SQL-ER:


“The crash of your computer during Windows Updates may have caused that !

I had this issue on my laptop since November, and it really bugged me.  I sifted through the event log and found the pattern of events that preceded the issue, and, probably, caused it.
In short, the pattern is as follows: Windows updates run automatically as scheduled, and when reboot is initiated after the updates are finished, the computer crashes (probably during reboot sequence).  When it boots up, it reports that the last shutdown was unexpected, and the issue begins to occur.
I spent 2 days trying to dig out a solution from the Internet, to no avail, until I came across this page.  It doesn’t say anything about this particular problem, but it gives more information about SVCHOST process that starts many services, including Group Policy Client.  It looks like during reboot a vital registry settings were lost during crash and Group Policy Client “don’t know” how to start.  Let me explain:
There are two places to look in the registry:

  1. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services this path should contain gpsvc key (a folder), which is responsible for service parameters and configuration.  I found that the key was intact, so, you do not touch anything here – just check that the key exists.
  2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SVCHOST This is the most important path you should look into, as it must contain the keys and values referred in the key #1.  Below are descriptions what must be present there.
  • There must be Multi-String value called GPSvcGroup. My laptop was missing it.  So, you should create multi-string value named GPSvcGroup and assign it value GPSvc.
  • Next, you must create a key (a folder) and name it GPSvcGroup – this key normally should be there, but, again, it was missin on my laptop.
  • Then open newly-created GPSvcGroup folder and create 2 DWORD values:
  1. First called AuthenticationCapabilities and you must give it a value of 0x00003020 (or 12320 in decimal)
  2. Second is called CoInitializeSecurityParam and it must have value of 1.

Once you complete all steps above, reboot the computer and the problem will be fixed.

Video walkthrough for those who are not very technical is here:

I am so relieved I was able to fix it, and hope this will help others with the similar issue.”













T-SQL FileExist

File Exits

SELECT dbo.myFileExist ('c:\Temp\Test.txt') AS FileExists
SELECT dbo.myFileExist ('c:\Temp\Test1.txt') AS FileExists

ALTER FUNCTION dbo.myFileExist (@FileName varchar(100))
DECLARE @FileExists int
EXECUTE master.dbo.xp_fileexist @FileName, @FileExists OUT
RETURN @FileExists

Display Picture in a Crystal Report from a FileName in a database table

1)Save a default “Not Available” image in your images folder (you
can download one from google small images).
2)open crystal reports
3)Go to the Insert menu.
4)Click on Picture. – Also works if you use an OLE Object
5)A window will open for you to choose a picture, choose the
default one from step 1.
6)click ok and place it on the report.
7)Right click the image & click Format Graphic.
8)In the form that will open, click on the “Picture” tab.
9)Click on the formula button next to “Graphic Location”.
10)In the formula editor that will open, just select the path
field from your table and save the formula.

Determine if a SQL table column has any unicode

Trying to reduce database-table-size by changing nvarchar to varchar where there is no unicode

SELECT TheColumn
FROM MyTable
WHERE TheColumn<>CONVERT(nvarchar(100),CONVERT(varchar(100),TheColumn))

SQL determine table row size

Personal note: See my SQL Monitor project

SELECT SCHEMA_NAME(so.schema_id) AS schemaname, OBJECT_NAME (sc.[id]) tablename
, COUNT (1) nr_columns
, SUM (sc.length) maxrowlength
FROM syscolumns sc
join sys.all_objects so on sc.[id] = so.[object_id]
--join sys.schemas s on so.schema_id = s.schema_id
WHERE so.is_ms_shipped = 0
GROUP BY so.schema_id, OBJECT_NAME (sc.[id])
ORDER BY SUM (sc.length) desc

SELECT SCHEMA_NAME(so.schema_id) AS schemaname, OBJECT_NAME (sc.[id]) tablename
, COUNT (1) nr_columns
, SUM (sc.length) maxrowlength
FROM syscolumns sc
join sys.all_objects so on sc.[id] = so.[object_id]
--join sys.schemas s on so.schema_id = s.schema_id
WHERE so.is_ms_shipped = 0
GROUP BY so.schema_id, OBJECT_NAME (sc.[id])
ORDER BY SUM (sc.length) desc

dbcc showcontig ('Production.Orders') with tableresults

Table space used

EXEC sp_spaceused 'Product.Operations'