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 Difference Between AutoEventWireup="true" and AutoEventWireup="False"
12 Answers Phoenix Technologies,
How do you do exception management?
1 Answers Accenture, BirlaSoft,
Difference between viewstate, cache, session
When would you not use the oleDbConnection object? a) To connect to an SQL 7.0 database. b) To connect to a DB/2 database. c) To connect to an Access database. d) To connect to an SQL 6.5 database.
What does uri mean?
Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?
About writting a query and SP which is better ?
Whats MSIL, and why should my developers need an appreciation of it if at all?
What is the use of session state and application state and difference between them?
How can we use Web API with ASP.NET Web Form?
From the given paragraph of text, write a program to match the strings of format “Any number of numerals followed by an underscore followed by any number of alphabets" ex:123_abc (Note:using regular expressions)
How do I send e-mail from an ASP.NET application ?