Using A Stored Procedure...

 
73   95.5
26 days ago
 

Can someone give me an example of using a stored proceudre in the DataAccess layer instead of inline sql statements.  Here is the original code in the Design Pattern Framework where I like to change this.

public Customer GetCustomer(int customerId)
{
    string sql =
      @" SELECT CustomerId, CompanyName, City, Country, Version
           FROM [Customer]
          WHERE CustomerId = @CustomerId";

     object[] parms = { "@CustomerId", customerId };
     return Db.Read(sql, Make, parms);
}

Thanks