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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:20:15+00:00 2026-05-26T19:20:15+00:00

My problem is that I am unable to view the DataSet on my client

  • 0

My problem is that I am unable to view the DataSet on my client side windows form. I am using the SetDataBinding method but I get an error saying that:

Error: "Systems.Windows.Forms.DataGridView" doesn't contain any defination for SetDataBinding and no extension method accepting first type of argument"

Here is web service code that returns Dataset:

  public class Service1 : System.Web.Services.WebService
  {
    [WebMethod]
    public DataSet getdata(String rollno)
    {
        try
        {
            using (SqlConnection myConnection = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=student;User ID=sa;Password=123"))
            {
                string select = "select * from checkrecord where rollno=@rollno";
                SqlDataAdapter da = new SqlDataAdapter(select, myConnection);
                DataSet ds = new DataSet();
                da.Fill(ds, "students");
                return (ds);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            return null;                
        }

    }

The client side code that binds the data:

      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Windows.Forms;
      using System.Web.Services;
      using System.Web.Services.Protocols;
      using WindowsFormsApplication1.dataset1;

     //dataset1 is my web reference name
    namespace WindowsFormsApplication1
    {
      public partial class Form1 : Form
      { 
          public Form1()
          {
              InitializeComponent();
          }
          private void calldatagrid_Click(object sender, EventArgs e)
          {
             Service1 MyService = new Service1();
            // Call the GetData method in the Web Service
            DataSet ds = MyService.getdata("abc");
            // Bind the DataSet to the Grid
            datagrid.SetDataBinding=ds;
          }
      }
   }
  • 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-26T19:20:16+00:00Added an answer on May 26, 2026 at 7:20 pm

    change datagrid.SetDataBinding=ds; line to datagrid.DataSource=ds.Table[0];

    use below piece of code:

     Service1 MyService = new Service1();
     // Call the GetData method in the Web Service
      DataSet ds = MyService.getdata("abc");
     // Bind the DataSet to the Grid
      datagrid.DataSource=ds.Table[0];
    

    another change:

    in your webservice change “select * from checkrecord where rollno=@rollno“; this line to “select * from checkrecord where rollno=\'”+rollno+”\’“;

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

Sidebar

Related Questions

The problem I am facing is that I am unable to store the checked
I have an odd reoccurring error that I believe is related to View State
I have what I think is a simple problem but have been unable to
I've been working on this application but have come across a problem that I
I have a big problem that I am capturing a view into a Bitmap
I have a JQuery (using JQuery 1.4.2) problem that exhibits only in IE8 in
I'm trying to write a re-usable .NET Assembly that implements WCF. My current problem
One problem that I come across regularly and yet don't have a solution to
A problem that we need to solve regularly at my workplace is how to
The problem that I am having has to do with the need to keep

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.