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 / 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 |
Is It Possible for Static Variables access normal variable? and Normal Varialbe Access the static Variables?
1 Answers Phoenix Technologies,
What are sql joins?
How do we sort the data from a dataset?
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?
Explain what is postback in asp. Net?
What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?
What are the objects of ASP.NET ?
Can you create an app domain ?
What is the displayafter property in updateprogress control?
What is meant by server side scripting?
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