If you have the primary database file (.MDF) for your database, you can easily install it via SQL Server Management Studio.
Start by loading up SQL Server Management Studio. Once loaded, right click on Databases in the Object Explorer and select Attach:
In the dialog that opens, choose Add.
Protip: Copy the filepath that appears in the new dialog into a Windows Explorer window. Drag the database file into that window to get it to the correct location more easily. Once you’ve done that click the Refresh icon in the Locate Database Files dialog.
Choose the database you wish to open and click OK.
Your database will now appear in the Attach Database dialog. However, a Log File will also be listed however it (most likely) doesn’t exist. If this is the case, you will need to select it and click Remove.
Once that is complete, click OK and enjoy your new database!
It is a best practice to rename your project files within your Visual Studio project. As your project grows having a number of files named Form1, Form2, Form3, etc will make finding the correct code difficult.
When renaming a file it is best to do so through the Solution Explorer. This will ensure that the filename and the class name match (which is also a best practice in .NET code).
Renaming a Project File
When the dialog appears, be sure to click Yes. This will go through your project and update any references to match the new name.
When finished, you should build your project (Build > Build Solution or CTRL+SHIFT+B) to ensure the rename didn’t cause any problems.
By default, Excel hides the Developer tab so the first step in starting with VBA is to expose it.
Excel > Show the Developer tab
Follow these steps to expose the Developer tab:
- Open the File menu
- Select Options
- In the Options menu, select Customize Ribbon
- Check Developer on the right
- Click OK
This applies to Visual Basic and C#.
There are a few best practices that should be done when you are creating a project in Visual Studio.
- Start by selecting
File > Project (
CTRL + SHIFT + N)
- Select the language you want to create your project in
- Select the project type you want
- Change the Name of the project to be something describing the work you are going to do
- Click OK
It is preferable to name the project at this point then to attempt to rename the project after it has been created.
VBA allows you to adopt a few lazy habits that can come back to haunt you later on. One of these is not needing to declare your variables prior to using them. Since VBA requires variables to have a type this leads to possible type confusion (you attempt to store the wrong type of value into a variable) and code that is more difficult to read.
Option Explicit to the top of your modules forces you to declare your variables (the IDE will prompt you when you forget). You can set-up the IDE to automatically add this option so you don’t forget.
In the VBA IDE go to Tools > Options
Ensure that Require Variable Declaration is checked. All new workbooks and modules will have
Option Explicit added.
Note: Your existing workbooks will not have
Option Explicit added automatically. You will need to add it in manually (and fix up any missing declarations).
On February 20 (12-1:30), the WebDev P2P group I co-champion will be holding our next talk: Introduction to Web APIs by (fellow co-champion) Brad Genereaux.
Are you Agile? Want to be more Agile? Want to retrospective better? Want to see Sean Yo (@seanyo) and myself ham it up like it’s comedy hour (maybe that won’t happen). Then come on out to our upcoming talk Real World Retrospectives as part of the Agile/Lean P2P group through Communitech.
— from Linchpin
We’re in the middle of a cold spell here in Ontario and the roads are slick with slush. Driving home from work my car was having trouble making it up a hill. With other anxious drivers behind me and me being stuck going 20 kph my gut reaction was to push harder on the gas. If you live in frosty regions, you’ll know that only makes it worse. The best option is to let up on the gas, let the wheel’s catch and start again.
Ease up. Get your bearings. Slow down to speed up.
In this post I will go through setting up XAMPP and Eclipse to let you work with PHP and one of its unit testing frameworks PHPUnit.