Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8462187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:05:54+00:00 2026-06-10T14:05:54+00:00

I am facing the below error ‘int’ does not contain a definition for ‘LeaveType’

  • 0

I am facing the below error

‘int’ does not contain a definition for ‘LeaveType’ and no extension method ‘LeaveType’ accepting a first argument of type ‘int’ could be found (are you missing a using directive or an assembly reference?)

here is my code :

public DataSet GetLeaveRecord(int empID)
{
    DataSet ds = new DataSet();
    try
    {
        SqlCommand cmd = new SqlCommand("[p_GetLeaveRecord_LMS]", conn);
        cmd.CommandType = CommandType.StoredProcedure;
        SqlDataAdapter adapter = new SqlDataAdapter(cmd);
        cmd.Parameters.AddWithValue("@LeaveType", empID.LeaveType);
        cmd.Parameters.AddWithValue("@IdEmployee", empID.EmployeeId);
        cmd.Parameters.AddWithValue("@DateFrom", empIDd.DateFrom);
        cmd.Parameters.AddWithValue("@DateTo ", empID.DateTo);
        cmd.Parameters.AddWithValue("@Reason", empID.Reason);
        if (conn.State == ConnectionState.Closed)
        {
            conn.Open();
        }
        adapter.Fill(ds);
    }
    catch (Exception e)
    {
        throw e;
    }
    finally
    {
        if (conn.State == ConnectionState.Open)
        {
            conn.Close();
        }
    }
    return ds;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:05:55+00:00Added an answer on June 10, 2026 at 2:05 pm

    You are passing empID as an int type parameter and later you are using it as a type in your parameters. For example.

     cmd.Parameters.AddWithValue("@LeaveType", empID.LeaveType);
    

    I believe you have to pass your object probably of EmployeeLeave type in your method

    GetLeaveRecord(int empID)
    

    Or you may get your object based on the ID in your method and then use that in your parameters

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Facing a problem, it seems my data stored in SQL Server does not stored
I am currently facing an error in JavaScript. The code is given below function
I am facing the same problem as the below one. Does any one has
I am facing a peculiar issue. Below is the stack trace of what error
I am trying to configure data-source in WAS 7 and facing below mentioned error.
I am facing problem while implementing https with webHttpBinding. I am getting below error
Please help as i am new in c# i have facing the below error
I got below JSON string, i facing issue parsing because it contains non english
I am facing problem while setting focus in EdiText. Below is my EditText property.
I have been facing issue with sphinx result set for string attribute. Below is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.