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

  • Home
  • SEARCH
  • 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 8326979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:56:57+00:00 2026-06-09T00:56:57+00:00

This is my code for taking data from the database (i use dataset) :

  • 0

This is my code for taking data from the database (i use dataset) :

public DataSet getJobVacancy(GetJobVacancyData data)
{
    try
    {
        string _SPName  = "dbo.SearchJob";
        SqlParameter[] sqlParam = new SqlParameter[3];
        sqlParam[0] = new SqlParameter("@Keyword", SqlDbType.VarChar, 25);

        if(data.Keyword == null || data.Keyword == "")
            sqlParam[0].Value = DBNull.Value;
        else
            sqlParam[0].Value = data.Keyword;

        sqlParam[0].Direction = ParameterDirection.Input;
        sqlParam[1] = new SqlParameter("@LocationID", SqlDbType.SmallInt);

        if(data.LocationID == null)
            sqlParam[1].Value = DBNull.Value;
        else
            sqlParam[1].Value = data.LocationID;

        sqlParam[1].Direction = ParameterDirection.Input;
        sqlParam[2] = new SqlParameter("@ExperienceYears", SqlDbType.TinyInt);

        if(data.ExperienceYears == null)
            sqlParam[2].Value = DBNull.Value;
        else
            sqlParam[2].Value = data.ExperienceYears;

        sqlParam[2].Direction = ParameterDirection.Input;

        return SqlHelper.ExecuteDataset(SystemConfiguration.AMDP2_ConnectionString,
                                        CommandType.StoredProcedure,
                                       _SPName,
                                       sqlParam);

    }
    catch (Exception ex)
    {
        throw ex;
    }
}

And this is my setter-getter :

public string JobVacancyID { get; set; }
public string PostingDate { get; set; }
public string ClosingDate { get; set; }
public string Position { get; set; }
public string Location { get; set; }
public string Keyword { get; set; }
public string LocationID { get; set; }
public string ExperienceYears { get; set; }

This one is my Repeater’s data bound :

protected void rptJob_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Item || 
        e.Item.ItemType == ListItemType.AlternatingItem)
    {
        DataRowView data = (DataRowView)e.Item.DataItem;

        Literal ltrDatePosted = (Literal)e.Item.FindControl("ltrDatePosted");
        Literal ltrClosingDate = (Literal)e.Item.FindControl("ltrClosingDate");
        LinkButton lbtnPosition = (LinkButton)e.Item.FindControl("lbtnPosition");
        Literal ltrLocation = (Literal)e.Item.FindControl("ltrLocation");
        Literal ltrExpYears = (Literal)e.Item.FindControl("ltrExpYears");
        Literal ltrJobVacancyID = (Literal)e.Item.FindControl("ltrJobVacancyID");

        ltrDatePosted.Text = data["PostingDate"].ToString();
        ltrClosingDate.Text = data["ClosingDate"].ToString();
        lbtnPosition.Text = data["Position"].ToString();
        ltrLocation.Text = data["LocationName"].ToString();
        ltrExpYears.Text = data["ExperienceYears"].ToString();
        ltrJobVacancyID.Text = data["JobVacancyID"].ToString(); //this is where the error occured
    }
}

This is my sql query/stored procedure (i have run this query and the JobVacancyID column is in the result) :

BEGIN
SELECT JobVacancyID, PostingDate, ClosingDate, Position, b.LocationName, ExperienceYears FROM TRJobVacancy a
JOIN LTLocation b on a.LocationID = b.LocationID    
WHERE Position LIKE '%'+ COALESCE(@Keyword,Position) + '%' AND COALESCE(@LocationID, a.LocationID) = a.LocationID AND COALESCE(@ExperienceYears,ExperienceYears)  = ExperienceYears

The error that i got is : “JobVacancyID is neither a DataColumn nor a DataRelation for table Table“

And the confusing fact’s are :
1. It’s only give an error at data[“JobVacancyID”], the others is smooth.
2. I think i don’t have a table named Table(the error said this)
Thanks 😀

  • 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-09T00:56:58+00:00Added an answer on June 9, 2026 at 12:56 am

    SORRY ALL…..i just miss type the variable..it tooks around 3hours to realize it @_@

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

Sidebar

Related Questions

I have this big function (1300+ lines of code) that takes data from the
I want to process every element of a for-loop. Taking this code, why is
This bit of code is taking almost a half second to execute. Could somebody
Taking the jQuery framework for example, if you run code like this: $(document).ready(function init()
It is taking .6-.8 seconds for this line of my code to execute in
i have an asp page in which i write C# code for taking data
I have to fetch 500K rows from the database and write that data into
I am taking datas from the users and storing into the database. My database
I know that when taking data from a form and putting it into a
I am trying to import data from a large database. I have two tables

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.