Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to load datagrid view from database but when i run the following code, it shows the length of the string in the columns.
C#
Entities db = new Entities();
            var dtstr = db.Shops.Select(d => d.ShopName).ToList();
            dataGridView1.DataSource = dtstr.ToList();
            dataGridView1.Refresh();

Length
5
5
4
5
Also how can is had edit and delete functionality in datagridview in windows form.

Thankful,
Usama
Posted

1 solution

 
Share this answer
 
Comments
osama.javed 20-Jul-13 10:55am    
Sir, I want to do it in c# windows application.
[no name] 22-Jul-13 4:18am    
Have you check the second link : Link2 ?
http://www.mindstick.com/Articles/9422cfc8-c2ed-4ec1-9fab-589eb850a863/?Insert%20Delete%20Update%20in%20Da

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