Microsoft .NET Framework

Abdulhakim M. Elrhumi 356 Reputation points
2021-01-11T10:57:07.29+00:00

Hi All

After run my project exe display Error:
55352-myprojecterror.png

Best Regards.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,011 questions
{count} votes

Accepted answer
  1. Karen Payne MVP 35,436 Reputation points
    2021-01-11T14:39:49.853+00:00

    Looks like the stored procedure sp_SelectAllEmp is missing. Please verify that the SP exists in the environment you are running the executable. Check the spelling of the SP in all environments too.

    So let's say you tried the code in development and then move to production or a test environment and in production or test the SP does not exists, this would be a reason for the SP not being located. Other solutions would be no permissions to see the SP.

    55414-11111111111.png

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Abdulhakim M. Elrhumi 356 Reputation points
    2021-01-11T14:15:15.213+00:00

    Hi karenpayneoregon

    In source code work correct and load data after compile project and run EXE not load data see my Error project:
    55395-erperror.png

    public frmEmployeeMain()
    {
    InitializeComponent();
    }

    cmdEmployee employeecmd = new cmdEmployee();  
    BindingSource bsEmployeemaster = new BindingSource();  
    
    //Get All Employees  
    public void LoadEmployeemaster()  
    {  
      List<cls_Employee> employeemaster = employeecmd.GetAllEmployee();  
      bsEmployeemaster.DataSource = employeemaster;  
      gcEmployeeMaster.DataSource = bsEmployeemaster;  
    }  
    private void frmEmployeeMain_Load(object sender, EventArgs e)  
    {  
      LoadEmployeemaster();  
    }  
    

    //

    Repository<cls_Employee> cmd = new Repository<cls_Employee>();
    public List<cls_Employee> GetAllEmployee()
    {
    try
    {
    return cmd.GetAll("exec sp_SelectAllEmp").ToList();
    }
    catch (Exception ex)
    {
    System.Windows.Forms.MessageBox.Show("Error:"+ex,"ERP",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Error);
    return null;
    }
    }
    //
    public class Repository<T> : DataConnection, IRepository<T> where T : class
    {
    private IDbConnection con = ConVal();
    public IEnumerable<T> GetAll(string query)
    {
    // con.Open();
    return con.Query<T>(query);
    //throw new NotImplementedException();
    }
    }

    Best Regards.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.