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 an application domain?
Explain the difference between an exe and a dll?
What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC
What does assemblyinfo.cs file consist of?
How to disable disable browser's Back button in asp.net (JavaScript)?
How would you create a permanent cookie?
I have created a configuration setting in my web.config and have kept it at the root level. How do I prevent it from being overridden by another web.config that appears lower in the hierarchy?
what is the jit? what is the type of jit and purpose of it>
How many types of controls are there in asp.net?
What are the features of asp.net mvc?
Explain the differences between clr & cts?
what is the exact purpose of http handlers and interfaces?
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)