I'm trying to get visual Studio to successfully call my stored procedure, which will clear a table. I'm tackling this without the use of a .dbml file and seem to be using regular Linq instead of Linq to SQL.
So far I have tried using the context.executeCommand options and other various fixes that have come up on YouTube or searching. I've decided to simply make a stored procedure in SQL Server and call it in Visual Studio. So far I've refreshed the stored procedures both in database and in Visual Studio's server view and have confirmed that Visual Studio knows that my Stored Procedure exists, it's just actually calling it that's the tough part.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
namespace namespace1
{
class Program
{
static void Main(string[] args)
{
using (var db = new Model2())
{
// This is the name of the stored procedure so I'm just
// trying to call it. I've also tried putting it inside a
// variable to see if that would work. Same problem.
db.sp_clearBTEligRpt();
// Error: Model2 does not contain a definition for
// "sp_clearBTELigRpt" and no extension method
// "sp_clearBTEligRpt" accepting a first argument of type
// 'Model2' could be found
}
The error that I get is posted in the comments on the code and as far as expected results go I want it to work and execute the stored procedure called.