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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we access view state value of this page in the next page?

994


Why session management is required?

1002


What is enableviewstate in asp net?

942


Explain parts of assembly?

957


What are the advantages and disadvantages of session?

1120


What is global.asax file used for?

1025


How will you load dynamic assembly?

991


How to disable cut, copy and paste in TextBox using jQuery in asp.net?

1193


What is the difference between custom web user control and a custom web server control?

962


What is an assembly? Explain its parts.

1064


Describe the master page.

950


Why mvc is faster than asp.net? : Asp.Net MVC

1044


Explain how cookies work. Give an example of cookie abuse.

1108


How can u debug your .net application?

1065


What’s difference between “optimistic” and “pessimistic” locking?

1058