Question Datagridview record save

prasad kulkarni

Well-known member
Joined
Sep 7, 2009
Messages
62
Programming Experience
1-3
Hi,

I am using vb.net 2005. In datagridview , I add column from design mode.
In DataSet I select all columns from my table and pass dataset to
datagridview's datasource. but my columns are repeat .
when I add column from design mode and save eg. 4 rows .
ie. dataadapter.update(dataset,"tablename") then record not save
in sql server 2000 database.

if any one know then reply me soon
 
When you add columns to the grid in the designer you need to set their DataPropertyName so that they know which column in the data source to bind to. Also, if you don't want the grid to automatically generate columns, you should set its AutoGenerateColumns property to False. That needs to be done in code before you set the DataSource.
 
Back
Top