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.



Hi, I am a fresher. i have a problem related to DataGrid . i have a data grid and i have to place..

Answer / 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

More ASP.NET Interview Questions

How to Separate background image and front image from original picture....

0 Answers   Sans Pareil IT Services,


To make Cache item dependent on a file,directory or other cached item ,you should create an instance of which clause?

1 Answers  


Explain what does mvc represent in asp.net? : asp.net mvc

0 Answers  


How to turn off cookies for a page?

0 Answers  


Can any one explain with the example how to capture the application error in Aplication_Error() method?

1 Answers   Infosys,






What is cookies cache and session?

0 Answers  


Explain about secure socket layer?

0 Answers  


Difference between viewstate, cache, session

2 Answers   Mind Tree,


To load your generated dataset with data which method do you invoke?

0 Answers   Siebel,


What is the difference between equals() and == in c#?

0 Answers  


What are the type of session in Asp.Net

3 Answers  


What does aspnet_regiis -i do ?

1 Answers  


Categories