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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:09:29+00:00 2026-06-03T07:09:29+00:00

I have grid in my page which have four columns with multiple rows Userid

  • 0

I have grid in my page which have four columns with multiple rows
Userid username stateid and statename

which collection i should use to send data to another page using session
my code is

string[] strArray = new string[] {}; 

        foreach (GridViewRow gr in gvCompany.Rows)
        {
           strArray =new string[4] {new[] {gr.Cells[0].Text}.ToString(), new[] {gr.Cells[1].Text}.ToString(), new[] {gr.Cells[2].Text}.ToString(),new[] {gr.Cells[3].Text}.ToString()};


        }
        Session["List"] = strArray;
        Response.Redirect("Tid.aspx?Mode=List");

on tid page my code is

string[] ls = new string[] { }; 
                  ls =(string[]) Session["List"];
                foreach (string st in ls )
                {
                    //get each cell
                }

but value of st is system.string rather than 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-03T07:09:31+00:00Added an answer on June 3, 2026 at 7:09 am

    Using an string[] is not recommended since the more fields will add in future the difficult it will get to keep the field and index relationship bug free..

    You can create a proper class object eg. Company and pass a List to other class, List is in System.Collections.Generic namespace.

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

Sidebar

Related Questions

I have a page in which I have a grid with 2 columns, one
Page contains four grid with same no of columns.so, i have created a usercontrol
I have some grid which use form edit. But after edit success then page
I have a page which contains a dynamically generated grid, where a user can
I have view page with both detailview and gridview the grid view should be
I have a grid which has a link to next page and I have
I have a grid table, which I do data binding on page load if
I have to build a page which contains some text boxes and a grid
I have a Default.aspx page in which I have bind a Grid. In the
I have a page which has a long grid/table data...I am testing it on

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.