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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:11:01+00:00 2026-06-13T06:11:01+00:00

I have web Service method that returns value of one column of a table.

  • 0

I have web Service method that returns value of one column of a table. I want add that value to my drop down list. Is there any easy way to do it.

Here is my web method that returns all conference_name in conference table.

[WebMethod(Description = "Retrieves all Conference")]
        public DataSet GetAllConference()
        {
            DataSet dataSet = new DataSet();
            // Create connection object
            OleDbConnection oleConn = new OleDbConnection(connString);
            try
            {
                oleConn.Open();
                string sql = "SELECT conference_name FROM Conference";
                OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sql, oleConn);
                dataAdapter.Fill(dataSet, "Conference");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            finally
            {
                oleConn.Close();
            }
            if (dataSet.Tables.Count <= 0)
                return null;
            else
                return dataSet;
        }

On user side there will be one dropdown list. How can i add the value return by the web method to the dropdown list.

  • 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-13T06:11:02+00:00Added an answer on June 13, 2026 at 6:11 am

    You need to add web reference of web service in order to call the method, You may read this post to know how add reference, After adding reference you can call the method adn fill the drop down by the code given below,

    DataSet ds = wsObject.GetAllConference();
    if(ds.Tables.Count > 0)
    {
       ddlist.DataTextField = "conference_name";
       ddlist.DataValueField = "conference_name"; //Change field to one you want.
       //ddlist.DataValueField = "IDColumnInTheDataTable"; //un comment after give right column name
       ddlist.DataSource = ds.Tables[0];
       ddlist.DataBind();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Web Service with Just one Web Method that returns a boolean
I have a web service that returns a decimal value into my json string
I have a service layer that exposes a method, which returns me a List,
I have a simple web service method that returns a simple java class as
I have a web service that returns a simple object: [System.CodeDom.Compiler.GeneratedCodeAttribute(System.Xml, 2.0.50727.4927)] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
Let's say you have a Javascript function that calls a web service method. So
I have a web service (ASMX) and in it, a web method that does
I have an object which is the return value for a web service method.
I wrote the most simple wcf service that have one method // return a+b
I have a webservice method that reads a photo and returns its byte data.

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.