HOWTO: Create VB .NET Stored Procedure Wrapper - General - Support Forums - CodeSmith Community
Welcome to the CodeSmith Community!

HOWTO: Create VB .NET Stored Procedure Wrapper

Support Forums

A description has not yet been added to this group.

HOWTO: Create VB .NET Stored Procedure Wrapper

  • rated by 0 users
  • This post has 1 Reply |
  • 1 Follower
  • Hi. I am evaluating your software and I must say that it looks like an awesome product!

    I've played with a few of the templates, namely AllCommandWrappers and CommandWrapperClass. What I want to be able to do is create a wrapper class for all my stored procedures. I would like them to all be in one class and in one file. I noticed when I ran the ALLCommandWrappers it created a separate file for each stored procedure.

    I've also noticed that these templates are in C# and I'm more of a VB .NET kind of guy. Do they offer VB .NET versions of these templates?

    I've included a little sample of what I would like my class to look like. Big Smile

     Public Class DataAccessLayer

    Public Shared ConnectionString As String = System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString")


    Public Shared Function STIGetDifferentLumberTypes(ByVal @PurchaseOrderID As Integer, ByVal @ProductionID As Integer, ByVal @ReturnID As Integer, ByVal @TransactionID As Integer) As DataView
    'Retrieve the parameter set
    Dim storedParams() As SqlParameter = New SqlParameter(3) {}
    storedParams = SqlHelperParameterCache.GetSpParameterSet(ConnectionString ,"STIGetDifferentLumberTypes")

    storedParams(0).Value = @PurchaseOrderID
    storedParams(1).Value = @ProductionID
    storedParams(2).Value = @ReturnID
    storedParams(3).Value = @TransactionID

    Dim ds As DataSet

    ds = SqlHelper.ExecuteDataset(ConnectionString,CommandType.StoredProcedure,"STIGetDifferentLumberTypes", storedParams)

    Return ds.Tables(0).DefaultView
    End Function

    ...

    End Class

    Thanks for your help!

  • Currently, there is only the C# version of the CommandWrapper.  I do think you could convert the CommandWrapperClassTemplate.cst to vb rather quickly and get the functionality you want.

Page 1 of 1 (2 items)