Hi,
I am a fresher. i have a problem related to DataGrid .
i have a data grid and i have to place a dropdown in the
datagrid.and i have to retrieve the values from the database
(sqlserver).please tell me any idea about the code.
Answer Posted / ignatius
put the code inCODEFILE
public DataSet PopulateDDList()
{
string sqlString ="select
emp_name,emp_id from emp_current where
emp_des='"+Des.PM+"'";/*ANY*/
SqlDataAdapter ad = new
SqlDataAdapter(sqlString,new log().db);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}
in the follwing aspx
<EditItemTemplate>
<asp:DropDownList id=DropDownList1 runat="server"
DataSource="<%#PopulateDDList()%>" DataTextField="emp_name"
DataValueField="emp_id">
</asp:DropDownList>
</EditItemTemplate>
Actually this is work well
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is session and cookies in asp.net?
Which property is used to identify the Page is Post Back in ASP.NET?
What is web router?
List the major built-in objects in asp.net?
What is the parent class of all the web server control?
What is difference between session and application in asp net?
Do session use cookies in asp net?
How can exception be handled with out the use of try catch?
What is the difference between visual basic and asp.net?
What is data binding in asp net?
What is enableviewstatemac in asp net?
Differentiate globalization and localization.
What is http protocol and how it works?
What is syntax code to send email from an asp.net application?
What is difference between Lambda Expression and LINQ in ASP.NET?