forum

home / developersection / forums / binding data with datagridview

Binding data with DataGridView

John Smith 3841 29-Sep-2010
Please let me know where I am wrong

Here binding data with datagridview control in C#

SqlConnection con =        new SqlConnection("server=****\\sqlexpress; uid=sa; password=sa;         database=****");     
                                   con.Open();
            SqlDataAdapter ada = new SqlDataAdapter("select * from tableName", con);
            DataTable dt = new DataTable();
            ada.Fill(dt);
            dataGridView1.DataSource = adaa;


c# c# 
Updated on 30-Sep-2010
John Smith

Sr. Software Developer

I am best.

Can you answer this question?

Answer

2 Answers

Liked By