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

Is It Possible for Static Variables access normal variable? and Normal Varialbe Access the static Variables?

1 Answers   Phoenix Technologies,


What are sql joins?

0 Answers  


How do we sort the data from a dataset?

0 Answers  


Describe briefly what is the role of IIS on an ASP.NET application? What does it for the same application?

0 Answers   InfoAxon Technologies,


What is a windows service?

0 Answers  






Explain what is postback in asp. Net?

0 Answers  


What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?

0 Answers   BirlaSoft,


What are the objects of ASP.NET ?

6 Answers  


Can you create an app domain ?

1 Answers  


What is the displayafter property in updateprogress control?

0 Answers  


What is meant by server side scripting?

0 Answers  


By default what is the Asp.Net application login context on IIS 5.0? By default the ASP.Net app runs in the context of a local user ASPNet on IIS version 5. On IIS version 6 on windows 2003 it is called Network service

0 Answers  


Categories