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
How can u debug your .net application?
What is a postback ispostback and autopostback in asp net?
What is protected configuration?
Do you know caching feature?
Define the term Web Garden?
Do session use cookies in asp net?
What is dynamic web page with example?
Which protocol is used in a web api?
Explain difference betn dataset and recordset?
What are session and cookies?
What do you mean by authorization?
Differentiate between authentication and authorization.
What are the modes of updation in an updatepanel?
Is oauth for authentication or authorization?
Where do the cookie state and session state information be stored?