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 |
WHAT IS THE SEQUENCE IN WHICH ASP.NET EVENTS IS PROCEED?
What are the three parts of an http response?
What is Http handler?
Describe the sequence of action takes place on the server when ASP.NET application starts first time?
Does the following statement executes successfully: Response.Write(?value of i = ? + i);
What does postback mean?
What is the difference between Classic ASP and ASP.Net?
Can we make activex dll also ti execute in some process as that of client ? How can we do?
What does setting a control's EnableViewState property to false accomplish?
How do you construct HtmlResponseMessage?
what is asp and asp.net ?
2 Answers Inspira Technologies,
How do you implement postback with a text box?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)