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

  • Home
  • SEARCH
  • 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 6116819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:15:01+00:00 2026-05-23T15:15:01+00:00

UPDATE: THIS IS THE WORKING VERSION. public DataSet GetObjects() { DataSet ds = new

  • 0

UPDATE: THIS IS THE WORKING VERSION.

public DataSet GetObjects()
{
    DataSet ds = new DataSet();
    DataTable dt = new DataTable();
    var source = from p in CommentsList
                 select new { p.Img, p.Name, p.Comment };
    dt.Columns.Add("Img");
    dt.Columns.Add("Name");
    dt.Columns.Add("Comment");

    foreach (var item in source)
    {
        DataRow userDetailsRow=dt.NewRow();
        userDetailsRow["Img"] = item.Img;
        userDetailsRow["Name"] = item.Name;

        DataRow comments = dt.NewRow();
        userDetailsRow["Comment"] = item.Comment;
        dt.Rows.Add(userDetailsRow);
        //dt.Rows.Add(comments);
    }
    ds.Tables.Add(dt);
    return ds;
}

My GridView columns section looks like this:

 <Columns>
  <asp:TemplateField HeaderText="#">
                    <HeaderStyle Width="500px" />
                     <ItemStyle Width="500px" Height="100px" />
                    <ItemTemplate>
                        <asp:Label ID="lblMessage" runat="server"  Text='<%# Bind("Comment") %>'></asp:Label>
                    </ItemTemplate>
   </asp:TemplateField>

       <asp:TemplateField HeaderText="#">
                    <HeaderStyle Width="100px" />
                      <ItemStyle Width="100px" Height="100px" />
                    <ItemTemplate>
                        <asp:Image ID="imgName" runat="server"  imageUrl='<%# Bind("Img") %>'></asp:Image><br />
                        <asp:Hyperlink ID="hyperLink" runat="server"  Text='<%# Bind("Name") %>' ></asp:Hyperlink>
                    </ItemTemplate>
   </asp:TemplateField>

UPDATE: The problem that I have got now is with the size of rows..that are huge and dont update with the content within,,,example: Header 33%, Row 33%, footer 33%..even though the content of the header is 10% of the gridview..how do i fix that?

  • 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-23T15:15:02+00:00Added an answer on May 23, 2026 at 3:15 pm

    You need to add a Column in your DataTable with the name of Img before using this in DataBinding

    userDetailsRow["User"] = item.Img;
    

    should be

    userDetailsRow["img"] = item.Img;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: This question was an epic failure, but here's the working solution. It's based
I get this error when I do an svn update : Working copy XXXXXXXX
UPDATE: this is a repost of How to make shell scripts robust to source
I have this classic ASP site which has been working fine until we updated
Update: This turned into a blog post, with updated links and code, over at
Update: this question, including the title, was rephrased, see history for details I know
Update: This does work, I was being stupid :( i have the following extension
Update: This is, as I was told, no principle Python related problem, but seems
UPDATE: This question is out of date, but left for informational purposes. Original Question
Update: This question is a duplicate of Are there any programming languages targeting PHP,

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.