Appreciate the help. I'm seeing the same thing that you're seeing... but all the on-line examples are just copies of the Microsoft examples... and they don't run. Really. The code samples that you have above don't run.
I did open Profiler and I'm seeing the data access happen.
I altered the stored proc to return a constant, the parameters are not really used. (I'll need them in the production code, but for now I'm trying to simplify)
In testing, I've found that if I alter my stored proc to return no rows, the code crashes (that's good, it means I have a good connection to the db) but *no matter what the fields are* the results are the same, I get the default class and not the populated
I'm thinking that the 'mapping' is not working as advertised and I'm trying to get the iRowMapper to work. The code that I have below crashes with
The expression must contain a MemberAccessExpression to a property ( t =>t.Property).
This appears to be a Lambda expression, but I can't make it work. VB crashes and says that 't' isn't defined.
My stored proc (note that there is no real data access, it returns a constant):
CREATE PROCEDURE dbo.FP_SOP10100_SEL_byID
select convert(int,2) as SOPTYPE
Note that this is a complete code example, it includes the class needed.
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As Database
db = EnterpriseLibraryContainer.Current.GetInstance(Of Database)("TWO")
Dim rowmapper As IRowMapper(Of SOP10100)
rowmapper = MapBuilder(Of SOP10100).MapNoProperties _
.Map(Function(x) x.SOPTYPE).ToColumn("SOPTYPE") _
Dim s = db.ExecuteSprocAccessor(Of SOP10100)("dbo.FP_SOP10100_SEL_byID", rowmapper, "ORDST2225", 2).SingleOrDefault
Catch ex As Exception
Public Class SOP10100
Public SOPTYPE As Int32 = 1