The following piece of code uses the My.Computer.Network.IsAvailable property to determine whether or not the computer is connected to a network. This network could be the Internet or a local network; for as long as the computer is connected to one such network, the response retrieved will be positive. This Visual Basic (VB.NET) code snippet is used […]
Internals Visible to Declarations Cannot Have a Version in SQL Server 2005 CTP
If you’re getting an error similar to the one below: [C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.SmoEnum\9.0.242.0__89845dcd8080cc91\Microsoft.SqlServer.SmoEnum.dll] InternalsVisibleTo declarations cannot have a version, culture, public key token, or processor architecture specified. (ObjectExplorer) If you’re getting this error when you try to connect to a SQL Server 2005 database using SQL Server Management Studio CTP, it’s because you installed .NET Framework 2.0 […]
How to get the current Unix timestamp in PHP
The Unix timestamp represents the time measured in seconds since the start of the Unix epoch (January 1st, 1970). The Unix timestamp is often inserted into databases, to date the records. Getting the Unix timestamp in PHP is done by using the time() function, which returns the current Unix timestamp of the server. Here we output the […]
How to retrieve a list of installed printers
Retrieving a list of available printers using .NET 2.0 is quite easy since it’s supported by the framework itself, and there’s no need to mess with unmanaged code. First add the using statement: Here’s the entire code in one page:
How to go back one page in the browser history using JavaScript
Using JavaScript you can go back or forward in the browser’s navigation history. Most of the time you want to go back one page by clicking a link in the page. For doing that, use the following code: <a href=”javascript:history.go(-1)”>Go back</a> It’s easy to figure out that to go back more pages in history, you […]
Cannot implicitly convert type ‘string’ to ‘System.Drawing.Color’
Certain ASP.NET controls such as the label can be assigned to it colors (background colors, foreground colors, etc.) at runtime from the code-behind files. Even though the label renders into an HTML entity, you cannot directly assign a color that is in the Hex format (such as #FF00EE); if you try you will receive the […]
Open a web page in the default browser
Opening an URL in the default browser using VB.NET could not be any simpler. All you need to do is to invoke the Process.Start() method and pass the URL of the page that you wish to open:
The operation could not be completed. Not enough storage is available to complete this operation.
When you try to execute a query on a SQL Server database, such as creating a stored procedure, a table or adding data to one, and you are receiving the error The operation could not be completed. Not enough storage is available to complete this operation. the cause may be one of the following: – The “Enable […]
The file web.sitemap required by XmlSiteMapProvider does not exist.
The most common case when the “The file web.sitemap required by XmlSiteMapProvider does not exist” error is received is when a SiteMap control was added to a WebForm, however you don’t have a mandatory Web.sitemap file in the root of your web application.To fix this error, make sure you have this file in the root directory, and that it is a […]
At compile I get error error CS0131: The left-hand side of an assignment must be a variable, property or indexer
You are trying to change the value of a constant or of a read-only property.