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 are the components of ado.net?
What is the difference between client-side and server-side validations in webpages?
What is view state and how it works in asp net?
How to use class library reference in asp.net project? Can you give me the example with source Class library haves classes like Database, insert, update, delete, reflection how can i use the database class connection in insert class to insert the record in to the Main Project in asp.net.
i need code for insert,delete,update adn display records using stored procedure in C#
we can able to display a MessageBox in asp .net without using any script langages?
How do you handle session management in ASP.NET and How do you implement them. How do you handle in case of SQLServer mode?
with which controls you worked in Asp.net 2.0?
2 Answers HP, nTech Solutions,
If i have a page where i create an instance of a dll and without invoking any method can I send values to next page ?
Explain the difference between asp and asp.net?
What is the difference between Hash table and Array list?
What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?
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)