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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:30:34+00:00 2026-05-20T21:30:34+00:00

Im trying to retrieve a path name from my Pictures table the pathname is

  • 0

Im trying to retrieve a path name from my Pictures table the pathname is stored under picturepath in my Pictures table I dont know how to join it on to my current sql syntax it uses the UserID which is set by a session.

And im unsure what goes in the commented line for my image url string?

    using (OdbcCommand cmd = new OdbcCommand("SELECT Wallpostings FROM WallPosting WHERE UserID=" + userId + " ORDER BY idWallPosting DESC", cn))
    {
        using (OdbcDataReader reader = cmd.ExecuteReader())
        {
            test1.Controls.Clear();

            while (reader.Read())
            {
                System.Web.UI.HtmlControls.HtmlGenericControl div = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                div.Attributes["class"] = "test";
        //div.Style["float"] = "left";

                div.ID = "test";
                Image img = new Image();
                img.ImageUrl = String.Format("{unsure}", reader.GetString(unsure));
                // this line needs to be represented in sql syntax
                img.AlternateText = "Test image";

                div.Controls.Add(img);
                div.Controls.Add(ParseControl(String.Format("{0}", reader.GetString(0))));
                div.Style["clear"] = "both";
                test1.Controls.Add(div);

enter image description here

  • 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-20T21:30:36+00:00Added an answer on May 20, 2026 at 9:30 pm
    img.ImageUrl = string.Format("~/userdata/2/uploadedimage/{0}", (string)reader["TheImageColumn"]);
    

    This will pull the TheImageColumn field from the reader and insert it where {0} is in the string.

    SQL

    SELECT
        wp.WallPostings,
        p.PicturePath
    FROM
        WallPosting wp
        LEFT JOIN [User] u ON u.UserID = wp.UserID
        LEFT JOIN Pictures p ON p.UserID = u.UserID
    WHERE UserID = @UserID
    ORDER BY idWallPosting DESC
    

    You should also not in-line your parameters, use cmd.AddParameter() instead.

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

Sidebar

Related Questions

I am trying retrieve user name from the code through graph api, the below
I am trying to retrieve a column from another related table, and display that
When trying to retrieve a massive folder path from an outlook mailbox (no 255
Iam trying to retrieve data from mysql database into stylesheet.php but it is not
Hi I am trying to retrieve values from database. I have a row which
I'm trying to retrieve a stored date in a MS Access 2003 database ..
I'm trying to retrieve product information from magento by calling its web service using
I am trying to use a textreader to retrieve data from a text file
I am trying to retrieve some values from the registry. Here is the full
I am trying to retrieve file details from files in the Program Files folder.

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.