Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
am beginner to .net i know the use of data grid but am unable to write code for the data grid.can please explain the code of the data grid and how to add the data delete the data cancel button using Sql server.please tell me better and simple way to understand the concept....
Posted
Comments
AnkitGoel.com 6-Dec-12 6:11am    
Probably you asking this question at wrong place, please google for it or search MSDN.
Jibesh 28-Feb-13 2:03am    
The best way is to google and find some sample source code and work with that If you have any trouble in using that then post the question here with more specific doubts rather like this. This is not a training site or online mentor program and this forum is for QA

ok i will do it for u.

A datagridview accept the datasource in the structured data format.you can use dataset, datatable, even a single datarow.

to add data in your gridview.
1.fetch data from database with the help of adopters.
2.use this adopter to fill dataset/datatable.
3.assign the dataset/datatable as a sourse of your grid.

look at this example:
DataGrid.DataSource Property[^]

every time you perform an operation on your grid. you must clear dataset first, then reload it with the new adopters.
 
Share this answer
 
v2

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