A network-related or instance-specific error occurred while establishing a connection to SQL Server

Here we go again! You are trying to connect to your freshly installed sql server 2008 R2 express edition using localhost as server name and you are getting this error.

 

The purpose of this article is to let you know that the fix might be as simple as connecting to the name instance instead of localhost. When you install sql server using the web platform installer tools  , the sql server is installed as a named instance so it is likely to be ComputerName\SQLEXPRESS not localhost.

If you are trying unsure about the server name please use the browse feature of this pop up to locate your server instance or use the command
sqlcmd -L
at the dos prompt.

If you can connect to your named instance but unable to connect to it from a nother comouter on the network you might have some configurations or firewall related issues . In such cases this article below is what you need. 
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

Reference and Related Links

Open a port windows Firewall

http://windows.microsoft.com/en-US/windows7/Open-a-port-in-Windows-Firewall

http://windows.microsoft.com/en-US/windows-vista/Open-a-port-in-Windows-Firewall

Change the Icon of a Hard Drive (Autorun.inf)

Let’s Say you want to change the icon of your Hard Drive.


Newer hard drives come with programs that set up their icons, but if you format the drive the icon is lost and the drive will rely on the operating system to get an icon. If you move the manufacturer program to another location on the drive you will need to change the autorun.inf to point to the new location.

If you navigate to the drive, you will see that there are no autorun.inf but if you try to create one you will most likely get this message:

This is because the file already exists. Some of you are thinking so let just go and “show hidden files and folders” that is not going to work either. If you want to edit the “autorun.inf” file you have to so do in Microsoft DOS.

Go to a start -> run a and type CMD


Navigate to the drive ( drive name : ) for example ” E:” and do an “edit autorun.inf” here you can see that the file really exists. The file however is read only to change that do run the following command:

attrib -r -a -s -h autorun.infNow you should be able to change the file either in DOS or in Windows. Change it to point to the location of the new icon which could be on the same drive or a different drive. Then run this command to hide the file again.

attrib +r +a +s +h autorun.infUnplug the drive from USB and Plug it again.

Here is the Proof

Reference
Default Icon Location Windows XP c:\windows\system32\shell.dll
You might want to download some ions in the process:
http://www.geekersmagazine.com/15-windows-7-icon-pack.html

Format DateTime In DropDown lists (VB.net, ASP.NET)

let’s say you retrieve a few dates from your database in this format:

2009-12-16 00:00:00.000
2010-01-20 00:00:00.000
2010-03-03 00:00:00.000

Now it is time to display them in a drop down list, before doing so you want to make sure that you have the right format. You would want to display something like 12/16/2009 in the drop down right?

You have two options:
1. Format the date in SQL first using something like :

select Distinct CONVERT(VARCHAR(10), MyDate  101) as MyDate from Table order by MyDate

Very soon you will find out that SQL does a bad poor job at ordering the list because the ordering happens after the conversion.

2. Use the Prerender event of the Dropdownlist
First the “DataTextFormatString” property does not work with date (stupid right?). The only way i have been able to get the right date is to use the “Prerender” Event of the Dropdown list and Loop through the items and change them on the Fly.

 
Protected Sub dd_date_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles dd_date.PreRender
Dim i As Integer
Dim MyDateTime As DateTime
For i = 1 To Me.dd_date.Items.Count - 1
 MyDateTime = FormatDateTime(Me.dd_date.Items(i).Text, DateFormat.ShortDate)
 Me.dd_date.Items(i).Text = MyDateTime.ToString("MM/dd/yyyy")
 Me.dd_date.Items(i).Value = MyDateTime.ToString("MM/dd/yyyy")
 Next
End Sub

Hopefully that will save some people some time

Godaddy is up For Sales (What?)

Godaddy is up For Sales. What? Are you Kidding?

Please tell me that this is not true but according to an article form WSJ

http://online.wsj.com/article/SB10001424052748703597204575484153733196856.html

http://www.zdnet.com/blog/btl/wsj-godaddy-for-sale-could-fetch-1-billion/39057

 it would seems that this is a true story.

I have used Godaddy for a few of my projects  and they are NOT too bad.  Hopefully IBM , Google, Oracle and others are watching, i wish that they could make a bid for that project. Godaddy needs to go to a major company.

I think that google could benefit from this sales.

It is going to be interesting. Anyway. I am already ready for an increase in hosting prices (Prices will most likely go up).

Error occurred during initialization of VM Windows 7, windows xp

Full Error Message:

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object


If you get this error message chances are that your java vm is corrupted (whatever that means) since there are not much out there to help us out.

Here is how we solved this issue:

1. Remove Java entirely (we use a software called revo uninstaller).  At the time of writing this software has a free version or you can simply buy it (note that YCSoftware is not affiliated with this company). We personally like this software because it removes any leftovers from the registry.

2. Download java from this page http://www.java.com/en/download/manual.jsp

3.  Install it.

4. Now go to your command line and type “java  -version” to test your achievement.