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

What's the use of response.output.write()?

1219


how to retrieve property settings from xml .config file.

939


What is anonymous authentication?

1085


Explain the Session state management options available with ASP.NET?

973


What is round trip in asp.net?

883


Is post back in asp.net?

918


What are the steps involved to fill a dataset?

970


How about the security in Activex DLL and Activex EXE ?

2230


What is the difference between ASP.NET Webforms and ASP.NET MVC?

1078


How do we ensure view state has not tampered?

964


What is the procedure to create the environment for asp.net? : asp.net mvc

980


what is meant by sitemapnode ?

1955


Explain the use of duration attribute of @outputcache page directive.

1054


Explain the difference between response.redirect vs server.transfer

1090


What is the use of view state?

891