- Execute Select command and return the data into DataTable
- DataTable
- Declare a DataTable variable DataTable dt
- Loop for Number of Rows: dt.Rows.Count
- Read value from DataTable: string str= dt.Rows["Column_Name"]
- Add item into DropDownList: ddl.Items.Add(str);
DataTable dt = Utilities.GetCurrency();
//it returns DataTable
for (int i = 0; i <
dt.Rows.Count; i++)
{
string
str=Convert.ToString(dt.Rows[i]["CURR_Currency_Name"]);
currencyDropDownList.Items.Add(str);
}
No comments:
Post a Comment