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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:25:10+00:00 2026-06-16T09:25:10+00:00

I have assigned two string array: string[] SelectColumns = {},WhereColumns={}; Both of them are

  • 0

I have assigned two string array:

string[] SelectColumns = {},WhereColumns={};

Both of them are full of data items. For example SelectColumns.length = 7,WhereColumns.Length=3;

When i went to implement them i got an exception: object reference not set to an instance of an object.
I am using them in below:

for (int i = 0; i < SelectColumns.Length; i++)
{
    DPS._SelectCol[i] = SelectColumns[i];
}

for (int i = 0; i < WhereColumns.Length; i++)
{
    DPS._WhereCol[i] = WhereColumns[i];
}

Here DPS is the object of a class, which is given below:

public class DefaultProfileSetting
{
    private string Server;

    public string _Server
    {
        get { return Server; }
        set { Server = value; }
    }

    private string Authentication;

    public string _Authentication
    {
        get { return Authentication; }
        set { Authentication = value; }
    }
    private string Login;

    public string _Login
    {
        get { return Login; }
        set { Login = value; }
    }
    private string Pass;

    public string _Pass
    {
        get { return Pass; }
        set { Pass = value; }
    }
    private string DB;

    public string _DB
    {
        get { return DB; }
        set { DB = value; }
    }
    private string Table;

    public string _Table
    {
        get { return Table; }
        set { Table = value; }
    }
    private string[] SelectCol;

    public string[] _SelectCol
    {
        get { return SelectCol; }
        set { SelectCol = value; }
    }
    private string[] WhereCol;

    public string[] _WhereCol
    {
        get { return WhereCol; }
        set { WhereCol = value; }
    }
}
  • 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-16T09:25:11+00:00Added an answer on June 16, 2026 at 9:25 am

    You probably have just string array reference _SelectCol but not actual array and need to instantiate the _SelectCol string array to allocate memory to its elements.

    DPS._SelectCol = new string [SelectColumns.Length];
    
    for (int i = 0; i < SelectColumns.Length; i++)
    {
        DPS._SelectCol[i] = SelectColumns[i];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two databound listboxes. The first only shows items that have been assigned
I have a string: str=D\\projects\\myown\\java I assigned this string to two variables like: str1=str
We have two tables - Tasks and TasksUsers (users assigned to task). Task has
I have two datepickers. When start date is selected, end date is automatically assigned
I have assigned a custom data attribute to some circles added to the Raphael
This is for automating a testing process. I have two string arrays (extracted from
I want to have an array of objects that is shared between two different
I have two domains : class CodeSetDetail { String id String codeSummaryId static hasMany
I have two arrays, both with the same indexes. What I want to do
I have two models Client and Topic . Both of which have a HABTM

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.