I've been working with Unit Testing that's available in VS-2008 Pro now. In the Project Tracker library, Project.vb Exists function. I keep getting data portal errors.
Protected
Overrides Sub DataPortal_Execute()Using cn As New SqlConnection(Database.PTrackerConnection)
cn.Open()
Using cm As SqlCommand = cn.CreateCommand
cm.CommandType = CommandType.Text
cm.CommandText = "SELECT Id FROM Projects WHERE Id=@id"
cm.Parameters.AddWithValue(
"@id", mId) Dim count As Integer = CInt(cm.ExecuteScalar)mExists = (count > 0)
End Using End Using End Sub I believe the Sql should be:"SELECT COUNT(Id) FROM Projects WHERE Id=@id"
This is in Visual Basic version 3.0.3-071127
I love this framework by the way and looking forward to the VB version of your 3.5 version book. That will be out before the C# version, right?
Burl
Huh... Actually, it should use the stored procedure:
"existsProject"cm.CommandType = CommandType.StoredProcedure
cm.CommandText =
Copyright (c) Marimer LLC