By Darren McLeod on
Saturday, July 12, 2008 8:02 AM
You have to change the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll from v8 to v9.
|
By Darren McLeod on
Saturday, June 14, 2008 9:15 AM
While at Tech-Ed 2008 in Orlando I picked up a copy of "Professional Refactoring in Visual Basic" by Danijel Arsenovski a Wrox Programmer to Programmer book by Wiley Publishing, Inc. This book is absolutely the best book I have seen on doing object oriented VB.NET programming in the real world. In my opinion it is absolutely required reading for anyone coding in VB.NET.
|
By Darren McLeod on
Friday, May 16, 2008 4:31 AM
If you have an EnvDTE.Project reference to an existing Solution Folder you can add a solution folder like so:
C#
((EnvDTE80.SolutionFolder)root.Object).AddSolutionFolder("solutionFolder");
or VB
DirectCast(root.[Object], EnvDTE80.SolutionFolder).AddSolutionFolder("solutionFolder")
where "root" is the EnvDTE.Project reference to the existing Solution Folder.
|
By Darren McLeod on
Saturday, May 10, 2008 5:34 AM
To unlock a file in Team Foundation Server you have to issue the following command at the Visual Studio Command Prompt:
TF UNDO filename /WORKSPACE:workspace;checkout_user /SERVER:servername
Where you change the lower case words with your particular case. For more information go here:
|
By Darren McLeod on
Saturday, April 19, 2008 6:09 AM
Every once in a while I need to search and replace a character with a "return" character and I forget how to do it and have to search online. This latest search I found the answer here:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=112303
In your search dialog turn on regular expressions and use "\x0d\x0a" for the "return" character.
|
By Darren McLeod on
Saturday, March 08, 2008 4:54 AM
I had changed the name of a class to match Code Analysis class name criteria that specifies what parts of a class name should be upper case/lower case. I did a global search and replace. Some time later I ran a unit test and got this error:
System.TypeLoadException: Could not load type
After a bit of research I discovered that even though the class I had changed casing on was a VB class the unit test class is case sensitive.
|
By Darren McLeod on
Sunday, February 03, 2008 6:44 PM
If your using the ASP.NET 2.0 Wizard control and you want to stop the next button from going to the next step you have to set the event arg property Cancel to true like so:
Private Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick
e.Cancel = True
End Sub
...
Read More »
|
By Darren McLeod on
Thursday, January 24, 2008 5:38 PM
Was using the MaintainScrollPositionOnPostback=true in a page directive with the ASP.Net 2.0 Wizard control and started getting a stack overflow error when clicking on a Sidebar button. Could not find a decent fix so I opted for a workaround and removed the MaintainScrollPositionOnPostback attribute and implemented this:
http://aspnet.4guysfromrolla.com/articles/111704-1.2.aspx
|
By Darren McLeod on
Monday, December 31, 2007 11:53 AM
Say you had the following select:
select id="ItemSelect" runat="server">
option selected="selected">Select your itemoption>
option>Item oneoption>
option>Item twooption>
option>Item threeoption>
select>
And you wanted to force the user to select Item one/two/three. You could do this by creating a RegularExpressionValidator to to accept anything but the “Select your item” option like so:
asp:RegularExpressionValidator ID="ItemRegularExpressionValidator" runat="server" ControlToValidate="ItemSelect"
ErrorMessage="Item Required" Text="*" SetFocusOnError="true" ValidationExpression="^((?!Select your item).)*$">asp:RegularExpressionValidator>
...
Read More »
|
By Darren McLeod on
Thursday, December 20, 2007 6:41 PM
Say you had a GridView with a dropdownlist like this:
asp:GridView ID="testGridView" runat="server">
Columns>
asp:BoundField DataField="TestField" />
asp:TemplateField>
ItemTemplate>
asp:DropDownList ID="TestDropDownList" runat="server" AutoPostBack="true">
asp:ListItem Value="1">Item 1asp:ListItem>
asp:ListItem Value="2">Item 2asp:ListItem>
asp:DropDownList>
ItemTemplate>
asp:TemplateField>
Columns>
asp:GridView>
And you set it’s datasource in the page load event like this:
ProtectedSub Page_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
If Not Me.IsPostBack Then
Dim testTable As New DataTable
Dim testColumn As New DataColumn
testColumn.ColumnName = "TestField"
testColumn.DataType = GetType(String)
testTable.Columns.Add(testColumn)
Dim testRow As DataRow
testRow = testTable.NewRow
testRow.Item("TestField") = "Item...
Read More »
|