Thursday, January 8, 2015

False positives generated by virus scanners

During the last year, the antivirus software running on my computer often pops up with warning messages when I build Visual Basic projects. This happens because the VB program I'm writing just happens to contain a sequence of binary bytes that matches a common sequence of bytes found in one of the many thousands of known malware programs on the Internet. These sequences of bytes are known as virus signatures, and they provide a useful way of identifying a possible threat to your computer. You will occasionally find, as I have, that your Visual Basic project refuses to build and run because your computer's antivirus scanner quarantines the application's EXE file. So, what can you do about this problem?

I usually turn off my virus scanner for a few minutes while I run the application. Of course, doing so leaves me vulnerable for a brief period of time, so I am always careful to avoid connecting my Web browser to suspicious Web sites, or clicking on email attachments while the scanner is turned off. The slight inconvenience is outweighed by knowing that my computer is safe. You can even go so far as to temporarily disable your Internet connection while building your project. Once your project is built, enable your virus scanner immediately.

Friday, February 21, 2014

The sample programs and instructor solutions for the Advanced VB 2010 book are grouped into Solution folders. When you open the .sln file for each chapter in Visual Studio, you will see all the projects for a single chapter in the Solution Explorer window. Personally, I find this a convenient way to switch between projects without having to reload each one in Visual Studio. But if you prefer to open the projects one by one, you can just delete the .sln and .suo files in the root folder of the chapter. Then, you can go to each chapter folder and double-click the .vbproj file to open an individual project.

--Enjoy!

Sunday, March 3, 2013

Upgrading a SQL Server Database File

If you have a Visual Basic or C# application that connected to a database file created under Visual Studio 2010, you may have noticed that Visual Studio will not let you open or browse the database using Visual Studio 2012 tools. In addition, this is the new required connection string for the LocalDB server in Visual Studio 2012, shown here for the Karate database used in our books:

Data Source=(LocalDB)\v11.0;
AttachDbFilename=|DataDirectory|\karate.mdf;
Integrated Security=True;Connect Timeout=30

Here's how to use Visual Studio 2012 to upgrade a database file from SQL 2008 Express to LocalDB (SQL 2012) version. Follow these steps:

1. In Solution Explorer, double-click the database filename. This will cause a following dialog window to appear saying that the database file is not compatible with the current instance of SQL Server. When you click the OK button to close this dialog, the database filename will appear in the Server Explorer window.
 
2. Right-click the filename in Server Explorer and select Modify Connection.
 
3. In the Modify Connection window, click the Advanced button.
 
4. In the Advanced Properties window, select (LocalDB)\v11.0 for the Data Source, and set User Instance to False. Then click the OK button.
 
5. When a dialog window confirms that you want to upgrade the database file, click the Yes button.
 
The database is now upgraded. In the future, if you want to confirm that a database has been upgraded, right-click its name in Server Explorer and select Properties. Look for the Version property, which should equal 11.00 or later.
If you want to see a more visual version of this tutorial, go to https://dl.dropbox.com/u/24290605/blog_examples/Upgrading_database.htm
Enjoy!
--Kip Irvine