Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have make one webserive which have code of this

C#
static SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["Connection"].ToString());

[WebMethod] public DataSet SQLBranchMaster() {

    String Load = "SELECT * FROM BranchMaster";
    conn.Open();
    SqlDataAdapter adapt = new SqlDataAdapter(Load,conn);
    DataSet ds = new DataSet();
    adapt.Fill(ds);
    conn.Close();
    return ds;

}
now on windows forms my code is

C#
dataGridView1 = new DataGridView();

// Service is my Webserive class name
// myservice is my reference added in the Winforms

        myservice.Service test = new myservice.Service();
        dataGridView1.DataSource = test.SQLBranchMaster();

how to do now ? nothing shown when i run the form
Posted
Updated 7-Mar-13 3:36am
v2
Comments
[no name] 7-Mar-13 9:40am    
Why are you creating an instance of DataGridView, setting the DataSource and then letting it go out of scope without doing anything with it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900