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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:34:11+00:00 2026-05-26T04:34:11+00:00

I am trying to read a string into an array and I get the

  • 0

I am trying to read a string into an array and I get the error “Cannot implecitly convert type ‘string’ to ‘string[]’.

The error occurs here:

string[] sepText = result.Tables[0].Rows[0].Field<string>("WebHTML").UrlDecode();

My full if else statement is below:

if (!string.IsNullOrEmpty(result.Tables[0].Rows[0].Field<string>("WebHTML")))
            {
                string[] sepText = result.Tables[0].Rows[0].Field<string>("WebHTML").UrlDecode();
                NewsContent.Text = sepText[1];
                if (!string.IsNullOrEmpty(sepText[0]))
                    Image1.ImageUrl = sepText[0];
                else
                    Image1.Visible = false;
                NewsTitle.Text = String.Format("<a href=\"{0}/news/{1}/{2}.aspx\">{3}</a>", Extensions.GetServerName(true), result.Tables[0].Rows[0].Field<int>("News_Item_ID"), result.Tables[0].Rows[0].Field<string>("Title").UrlFormat(), result.Tables[0].Rows[0].Field<string>("Title"));
                Hyperlink1.NavigateUrl = String.Format("{0}/news/{1}/{2}.aspx", Extensions.GetServerName(true), result.Tables[0].Rows[0].Field<int>("News_Item_ID"), result.Tables[0].Rows[0].Field<string>("Title").UrlFormat());
            }
            else
            {
                Hyperlink1.Visible = false;
                Image1.Visible = false;
            }

Thank you for your help!

EDIT Code for URL Decode:

public static string UrlDecode(this string str)
{
    return System.Web.HttpUtility.UrlDecode(str);
}
  • 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-26T04:34:11+00:00Added an answer on May 26, 2026 at 4:34 am

    result.Tables[0].Rows[0].Field<string>("WebHTML") is going to give you the value of the WebHTML field in the first row in the first table which is a single string rather than a string[].

    You may want to show your code for UrlDecode() since it looks like a custom implementation rather than one of the built-in framework versions.

    You also declare the UrlDecode method to take a string as a parameter and return a string. Remember, a string is not the same thing as a string array.

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

Sidebar

Related Questions

I am trying to read in a string from a C# Response.Write(string example) into
I'm trying to read a file line by line to a string type variable
I am trying to convert a string I read in from a file to
SO I am trying to get a simple dataset from the strInstallDataSet string into
I'm trying to read in a multi line string then split it then print
I am trying to read contents of a file using string tokenizer and store
I am trying to read certain values from a json string in php, I
I am trying to read strings from a file that has each string on
I'm trying to save a struct with a char* string into a file. struct
I am trying to open these two files and read their contents into two

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.