im working on an asp.net website with a gridview.
The gridview has data from an sql database.
Like:
Cuntry----Name
USA--------John
England----Frank
...
The data is loaded in to the gridview like this:
SqlCommand cmd;
cmd = new SqlCommand();
cmd.Connection = sqlConn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_loadData";
sqlConn.Open();
dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
So, in the name column, i want a dropdownlist. And I want the dropdownlist with the corresponding value from the database selected.
How can I do this?
Thanks