Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 .NET4
hello sir i m try to show dataset values in datagrid view control.condition is that "before calling dataset i allredy created Datagridview column" and i want whenever i call Dataset then values show on my existence column not create another column....
 
so plz help me this problem....
Posted 26-Dec-12 18:52pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I solve my self........
 

SqlConnection con = new SqlConnection("Data Source=.; Initial Catalog=sham; Integrated Security=True");
            con.Open();
            SqlDataAdapter da = new SqlDataAdapter("Select Name,Address from Employee", con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            CustName.DataPropertyName = "Name";
            CustAddress.DataPropertyName = "Address";
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = ds.Tables[0].DefaultView;
  Permalink  
v4

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



Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 27 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid