protected void bind_servicestype()
{
try
{
// bind dropdown from database
string query="select Deposit_Type from Add_Deposit_Type";
DataSet ds = connection.dataadapter(query);
DropDownList1.DataSource = ds.Tables[0];
DropDownList1.DataTextField = "Deposit_Type";
DropDownList1.DataValueField = "Deposit_Type";
DropDownList1.DataBind();
// insert a default value in the dropdown
DropDownList1.Items.Insert(0, new ListItem("---------Select--------", "0"));
}
catch (Exception EXP)
{
Response.Write(EXP.Message);
}
{
try
{
// bind dropdown from database
string query="select Deposit_Type from Add_Deposit_Type";
DataSet ds = connection.dataadapter(query);
DropDownList1.DataSource = ds.Tables[0];
DropDownList1.DataTextField = "Deposit_Type";
DropDownList1.DataValueField = "Deposit_Type";
DropDownList1.DataBind();
// insert a default value in the dropdown
DropDownList1.Items.Insert(0, new ListItem("---------Select--------", "0"));
}
catch (Exception EXP)
{
Response.Write(EXP.Message);
}
No comments:
Post a Comment