Monday, August 11, 2008

iWebService ITADMIN with web 2.0 interface


Today I have uploaded my iwebservice projects code of ITADMIN module. The site is based on Ajax and web 2.0 like UI.

You can download the source code from project web service


I will update latest version soon… till then TC



Evan

+8801553466670

bdways@gmail.com

How to assign data source of drop down menu with dataset?

Things we should know:

  • How to create one dataset
  • Some basic properties of Drop Down menu

Lets start

1. first create your dataset and place your drop down menu control on the page.
2. now lets go to the coding part...... in my example

/// i have created one object of table adapter named dep

AgroEGovTableAdapters.DepartmentTableAdapter dep = new AgroEGovTableAdapters.DepartmentTableAdapter();

///this is the page loading class where we should place the data source for the drop down


protected void Page_Load(object sender, EventArgs e){

if (!IsPostBack)
{
//// assign data source of drop down to dep. GetDepData() where getDepData() gets all the fields of department table


DropDownList1.DataSource = dep.GetDepData();


////// assign deta text value of drop down control to DepartmentName colum of datset table adapter


DropDownList1.DataTextField = "DepartmentName";


///// assign deta text value of drop down control to DepartmentID colum of datset table adapter


DropDownList1.DataValueField = "DepartmentID";

//// finaly you have to bing the data in drop down menu control
DropDownList1.DataBind();

}
}



That's it …… like this you can bind your drop down control values with your dataset adapter


Evan

+8801553466670

ITVISION