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

To redirect the user to another page which method do we use without performing a round trip to the client?

0 Answers   Siebel,


What is asp.net and its advantages?

0 Answers  


Which object wraps the state or data of a user?

0 Answers  


What is the question mark in a url?

0 Answers  


Usage of web.config?

2 Answers   Microsoft,






What are the new features added from ASP to ASP.NET?

0 Answers   Amdocs,


When does a session actually start?

0 Answers  


Diff between web user control and web custom control?

0 Answers  


can sn.exe can be used before gacutil.exe

2 Answers   Accenture,


How to configure a website without using IIS.

3 Answers   CGI,


What is event in asp.net?

0 Answers  


Explain asp.net page life cycle?

0 Answers  


Categories