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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:32:57+00:00 2026-06-06T03:32:57+00:00

I am trying to build a sql query which will run a stored procedure.

  • 0

I am trying to build a sql query which will run a stored procedure. I then need the result of this query to appear in a listbox from which a user can select the desired result.

Please could someone show me how to construct the SQL query from scratch first of all, then show me how to get this result into a listbox?

Thanks in advance!

  • 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-06T03:32:59+00:00Added an answer on June 6, 2026 at 3:32 am

    http://www.dotnetperls.com/sqldataadapter

    using System.Data;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                FillData();
            }
    
            void FillData()
            {
                var connString = ConfigurationManager
                    .ConnectionStrings[name].ConnectionString;
    
                using (SqlConnection c = new SqlConnection(connString))
                {
                    c.Open();
    
                    // use a SqlAdapter to execute the query
                    using (SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM EmployeeIDs", c))
                    {            
                        // fill a data table
                        var t = new DataTable();
                        a.Fill(t);
    
                        // Bind the table to the list box
                        listBox1.DisplayMember = "NameOfColumnToBeDisplayed";
                        listBox1.ValueMember = "NameOfColumnToUseValueFrom";
                        listBox1.DataSource = t;
                    }
                }
            }
        }        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help in resolving a complex SQL query. I am trying to build
In this live SQL Server 2008 (build 10.0.1600) database, there's an Events table, which
I have been trying to build an SQL query to return matches between three
I am trying to build a sql query that I think it involves inner
I'm trying to figure out how to build a SQL query in following way:
I am trying to build a SQL query using ActiveRecord methods. The query has
I'm trying to build an sql query with no success. As I'm a newbie
I am trying to build SQL for a parameter query in C# for a
I am trying to build a dynamic sql query in java (shown below) sqlStr
I'm still trying to get the hang of SQL. I built 1 query that

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.