Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

difference between gridview,data list and repeater control

7 Answers   ABC, Olive Tech,


what are the sitemap providers in Asp.net 2.0?

2 Answers  


i wand basic interview based questions in asp.net and vb.net

0 Answers   Legio Infotech,


What is an assembly?

2 Answers   Value Labs,


How would you implement inheritance using c#?

0 Answers  


What is ViewState ? and how it is managed ?

1 Answers  


What is query string?

0 Answers  


when using windows API in .net then it is managed code or Unmanaged code?

2 Answers  


In a webpage if i want to give access to only half page ,then what should i do?

3 Answers  


Less than one page, how many windows will you be able to maintain?

0 Answers   Atos Origin,


What are custom user controls in asp.net?

0 Answers  


What?s the difference between Response.Write() and Response.Output.Write()?

2 Answers   Siebel, Visual Soft,


Categories