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 7049817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:04:03+00:00 2026-05-28T03:04:03+00:00

I am getting the Cannot call method on varchar error on the adapter.Fill(dtROI). Can

  • 0

I am getting the “Cannot call method on varchar” error on the “adapter.Fill(dtROI)”. Can you please help me out? I am trying to fill the data table with the adapter results from the sql statement.

protected void LoadData()
{
    DateTime StartDate = dpStartDate.Date;
    DateTime EndDate = dpEndDate.Date;

    string sql = string.Empty;

    using (SqlConnection conn = new SqlConnection())
    {
        conn.ConnectionString = ConfigurationManager.ConnectionStrings["VTC"].ConnectionString;
        conn.Open();

        sql = "select RESERVATION.MEETING_PURPOSE, RESERVATION.PROGRAM_AREA, RESERVATION.START_DATE, RESERVATION.END_DATE, " +
                     "ROI_TRACKING.ENTRY_LOCATION, ROI_TRACKING.SALARY_SAVINGS, ROI_TRACKING.TRANSPORTATION_SAVINGS, ROI_TRACKING.TOTAL_SAVINGS. " +
                     "ROI_TRACKING.TOTAL_DISTANCE, ROI_TRACKING.TOTAL_FUEL, ROI_TRACKING.TOTAL_GSA, ROI_TRACKING.TOTAL_AIRFARE, ROI_TRACKING.TOTAL_INSPECTOR_SALARY, " +
                     "ROI_TRACKING.TOTAL_MGR_SALARY, ROI_TRACKING.TOTAL_SUPERVISOR_SALARY " +
                     "from RESERVATION, ROI_TRACKING WHERE ROI_TRACKING.MEETING_ID = RESERVATION.MEETING_ID";

        using (SqlCommand cmd = new SqlCommand(sql, conn))
        {
            SqlDataAdapter adapter = new SqlDataAdapter();
            adapter.SelectCommand = cmd;

            DataTable dtROI = new DataTable();
            adapter.Fill(dtROI);
            gridReports.DataSource = dtROI;
            gridReports.DataBind();

        }

        if (chkDate.Checked == true)
        {
            FilterDataGridByDate(StartDate, EndDate);
        }
    }
}
  • 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-05-28T03:04:04+00:00Added an answer on May 28, 2026 at 3:04 am

    I noticed you have ‘.’ instead of ‘,’ after

    ROI_TRACKING.TOTAL_SAVINGS.
    

    It should be

    ROI_TRACKING.TOTAL_SAVINGS,
    

    Hope this will help.

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

Sidebar

Related Questions

I'm getting the following error message in jQuery Mobile: Cannot call method 'trigger' of
I am getting the error Cannot resolve TargetName grdGeneral . What I am trying
I cannot seem to figure out I am getting the following error in IE
I am getting very frustrated because I cannot seem to figure out why Collections
I am getting the error A field initializer cannot reference the nonstatic field, While
I'm getting the following error when calling a stored procedure: Cannot find the object
We are getting this error after upgrading to NHibernate 2.1. [QueryException: Cannot simultaneously fetch
I cannot understand why this simple query is not created. I call this method
I'm having trouble getting the C# compiler to call an extension method I created,
I have a query in a method so I can call i from multiple

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.