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 is the Difference between Web.config and global.asax? Can we write connection String code in global.asax?
If I m using Session State Partioning where I have partitioned my session into 4 servers then how can I know that my session will be stored on which server?
Difference between ISQL and OSQL??
Explain difference between dataset and recordset?
How to disable SOAP1.2 in Web Services?
What is cross page posting? How is it done?
What is _viewstart?
Explain the difference between asp & asp.net.
What is the difference between HTTP-Post and HTTP-Get ?
What’s the difference between asp.net web forms and asp.net mvc?
How many types of sessions in asp.net?
what are partial postbacks?