1st do not create any columns for dgv!
They will be created automatically when binding data.
Then use this code:
dataGridView1.DataSource = new BindingSource(ds.Tables, null);
//ds is a reference of dataSet, while Tables is the 1st dataTable from DataSet.
//if you have more then one dataTable, if you want to bind 2nd table, then do: Tables!
thank's for your help but its not my problem those are my codes please see it if you have time and resolve my problem
con = new SqlConnection(MC.StrCon);
strSql = "Select * from Anb_Tbl_Anbar";
da = new SqlDataAdapter(strSql,con);
this line is my problem ----> dataGrid_Tbl_Anbar.DataBindings.Add("Columns[<1>].clm",ds,"Anb_Tbl_Anbar.Anb_Fld_AnbarCode"); <-------
i can fill the data gird view easily but i want to fill in special columns that i created before please help me
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...