Dear Freinds
i face a problem in show the data from datagridview

actually i make a 4 column in datagridview now i want the four columns of table come in same columns in datagridview but when i show data in gridview it add more 4 columns and show data in those 4 column

Recommended Answers

All 4 Replies

Dear Freinds
i face a problem in show the data from datagridview

actually i make a 4 column in datagridview now i want the four columns of table come in same columns in datagridview but when i show data in gridview it add more 4 columns and show data in those 4 column

did you make the column in the datagridview manually? because if you want to show the four columns in a datagridview, you don't have to manually make columns, just bind the datagridview it your datasource and it will automatically create columns for you..
but...
but if you really want to put the data from the four columns to the other four columns that you already made in the datagridview, you should insert it.. use insert statements..
hope this could help...

Dear Freinds
i face a problem in show the data from datagridview

actually i make a 4 column in datagridview now i want the four columns of table come in same columns in datagridview but when i show data in gridview it add more 4 columns and show data in those 4 column

Hi!

>>>> i want the four columns of table come in same columns in datagridview

Can you please elaborate it ???

you need to post the code through which you populate the datagridView, so that we could check that why this is happening.

yr in simple words i want that sql show the data in already made columns in datagird in form level

I think you have created some columns manually and then binding source to the datagridview. so, you can add this line before binding: (which will clear datagridview first then bind the columns which are needed)

dataGridView1.Columns.Clear(); 
// Now Bind DataGridview
dataGridView1.DataSource = SomeTable_OR_SomeBindingSource;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.