DOne :)
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataClassesDataContext countries = new DataClassesDataContext();
DropDownList1.DataSource = countries.SelectCountries();
DropDownList1.DataTextField = "CountryName";
DropDownList1.DataBind();
}
}
As
DataClassesDataContext
>>> is a Link to SQL Classes
&
SelectCountries
>>>> is a class in
DataClassesDataContext
, that Select all countries from countries table
&
CountryName
>>> is the selected column from countries table
Thanks all for answers :)