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 |
To redirect the user to another page which method do we use without performing a round trip to the client?
What is asp.net and its advantages?
Which object wraps the state or data of a user?
What is the question mark in a url?
Usage of web.config?
What are the new features added from ASP to ASP.NET?
When does a session actually start?
Diff between web user control and web custom control?
can sn.exe can be used before gacutil.exe
How to configure a website without using IIS.
What is event in asp.net?
Explain asp.net page life cycle?