Calling a Stored Procedure from using my repository behavior

When using my repository code, this is the way to call a stored procedure from within a C# project:

      public void DeleteRelatedTemplatedTimeEntries(int id)
        {

            string commandText = "exec usp_DeleteTemplatedTimeEntryByTemplateId @TemplateId";
            
            var p = new SqlParameter();
           
            p.DbType = DbType.Int16;
            p.Value = id;
            p.ParameterName = "@TemplateId";
        
            SqlParameter[] ps = new SqlParameter[]{p};
            _repoBehavior.ExecuteStoreCommand(commandText, ps);
            //_repoBehavior.ExecuteStoredProcedure(commandText, ps);
        }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s