Posts

Is there a benign virus I can use to test the AV scanner?

Q: Is there a benign virus I can use to test the AV scanner? A: Eicar.org offers a benignvirus used for testing purposes. Although they don't offer support for any specific Anti-virus scanning tool, they can provide a simple virus that would help test your AV application. For more information and to download the virus, visit http://www.eicar.org/anti_virus_test_file.htm . Thanks to Andrew H. for providing an answer to this question.

How to search multiple columns, in 1 or more tables, for a single string?

Q: How can I search all varchar columns in a given table for a specific string, without building the where clause for every field? A: select * from table1 where val1 + val2 like '%xyz%' /* where val1 and val2 are varchar columns */ Also, if you have full text indexes defined on the columns of a table you can use the contains clause to examine each column that is indexed. If all of the varchar columns in mytable are are included in the fulltext index, then following will return any row that has the string abc : select * from mytable where contains(*, '"*abc*" ) Thanks to Pete F. for helping with this question.

IE Tab browsing

For those who enjoy using FireFox because of its ability to browse within tabs, IE is now offering a similar solution. With the help of the MSN toolbar, IE6 is now capable of tab browsing. To download the MSN toolbar, go to http://toolbar.msn.com/ . This is toolbar is a production release, and is free of charge. In addition, several other tools are available on the same page (i.e. Windows Desktop Search, Internet Search tools, etc).

IE Developer Toolbar

In keeping up with FireFox and it's development toolbar, Microsoft released a similar developer toolbar for Internet Explorer. For more information and to download the toolbar, go to http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en Please note that this IE toolbar is still a Beta!

Why is "Save" grayed out on MS-Word 2003?

Q: I'm able to open a document in MS-Word 2003, but not able to make changes or save it. Why is "Save" grayed out on MS-Word 2003? A: After some digging, it appeared that a virus had infected the user's system and de-activated Office 2003. After retrieving the registration number and re-activating MS-Office, everything should work fine as expected.

Invalid path for child request

Q: I call another web page from the application and pass it an argument (see sample below), but I receive the error "Invalid path for child request". Dim strPath As String = "Error.aspx?Msg=" & strMsg Server.Transfer(strPath, True) A: Since the argument passed is not URL encoded, it causes the path of the web page being called to be incorrect. To correct the problem simply URL encode the argument being passed to the new page. Dim strPath As String = "Error.aspx?Msg=" & Server.UrlEncode(strMsg) Server.Transfer(strPath, True)

How do you throw an exception?

Q: How do you throw an exception? A: The Throw() method is used to induce an error into the error handling routine. To generate an error, simply declare an object of type "Exception" with the desired message. Then call the Throw() method to send this error message to the error handling routine ("Catch" block). Once Throw() is called, all intermediate code will be skipped and execution will transfer to the "Catch" block, where Ex.Message="Something wrong happened!" See the code example listed below: Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click Try 'Some code logic here... Dim ex As New Exception("Something wrong happened!") Throw ex 'Some code logic here... Catch ex As Exception 'Catch a generic exception. Dim strMsg As String strMsg = "Error: " & Ex.Message & ControlChars.CrLf strMsg &= "Stack Trace: " & Ex.StackTrace & Con...