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.



Hi, I am a fresher. i have a problem related to DataGrid . i have a data grid and i have to place..

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

Post New Answer

More ASP.NET Interview Questions

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

2 Answers   Mind Tree,


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.

6 Answers   Syntax Softtech,


What does uri mean?

0 Answers  


Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?

0 Answers  


About writting a query and SP which is better ?

5 Answers   Abacus, Satyam,


Whats MSIL, and why should my developers need an appreciation of it if at all?

3 Answers   Siebel,


What is the use of session state and application state and difference between them?

0 Answers  


How can we use Web API with ASP.NET Web Form?

0 Answers  


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)

4 Answers   Microsoft,


How do I send e-mail from an ASP.NET application ?

1 Answers  


Categories