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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:24:52+00:00 2026-05-16T06:24:52+00:00

here, i want to check only if the column Active is Yes, then get

  • 0

here, i want to check only if the column Active is Yes, then get into the if loop. But it gives me an error “Cannot convert from string to int” for the last condition in if. What do you guys i can do. Thanks!!

if (ds != null && ds.Tables != null 
     && ds.Tables.Count > 0 
     && ds.Tables[0].Rows.Count > 0 
     && ds.Tables[0].Columns[0].ColumnName["Status"] == "Y")
        {
            disableloc.DataSource = ds;
            disableloc.DataBind();
        }
        else
        {
            ds = null;
            disableloc.DataSource = ds;
            disableloc.DataBind();

The stored procedure is SELECT ML.locationname,
rtrim(ML.address) + (CASE WHEN ML.Address2 IS NOT NULL THEN (” ” + rtrim(ML.Address2)) ELSE ”” END) + ” – ”+ ML.city + ”, ”+ ML.state as address,
ML.locationid,
ML.merchantid,
case when ML.active <> ”Y” then ”Deactive” else ”Active” end [Status],
(SELECT count() as retval
FROM merchant_statistics
WHERE type = ”merchant”
AND locationID= ML.LocationID
AND status = ”clicked”) as stat,
” ” as button,” ” as blank ,
dbo.GetCouponCountForLocations(@_merchantid,ML.locationID) couponCount,
MP.DomainName,
(SELECT Count(
) FROM Promotion WHERE LocationId = ML.locationid AND PostType = 1) AS jobs
FROM merchant_location ML , Merchant_Pages MP
WHERE MP.LocationID = ML.LocationID
AND ML.merchantid = @_merchantid Order By ‘

  • 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-16T06:24:53+00:00Added an answer on May 16, 2026 at 6:24 am

    Your compilation error is caused because ColumnName returns a String, and the only indexer String defines is an integer indexer that returns the character at the specified position.

    Assuming you are trying to access the value of the “Active” column for the first row:

    ds.Tables[0].Columns[0].ColumnName["Active"] == "Y"

    should be

    ds.Tables[0].Rows[0]["Active"] == "Y"

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

Sidebar

Related Questions

I want to check if my many column in datagridview is empty. here my
I am having problems here if I want to check if eerste points to
enter code here Want to remove items from a Main list , but give
I'm not entirely sure if I can do what I want here, but I
In my SQLite database only one row effect but I want effect 4 rows
Here I want to check whether date from database lies between financial year or
This is my ajax image uploade code.Here i want also check size of the
I want to make an AUTO_INCREMENT column in a database table,here is the syntax
I used Infragistics WebDataGrid , I have BoundCheckBoxField column, I want remove partial check
Here i want to do UDP Socket programming in C. I have one device

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.