public delegate DataTable loadDataTable();
DataTable shops = (cmbShop.Text == "All Shops") ?
new loadDataTable(() =>
{
Program.con.GET_Table_From_DataBase("sh", "select * from shops ");
return Program.con.dst.Tables["sh"];
}
).Invoke()
:
new loadDataTable(() =>
{
Program.con.GET_Table_From_DataBase("sh", "select * from shops where shopname='" + cmbShop.Text + "' ");
return Program.con.dst.Tables["sh"];
}
).Invoke();
I am just setting the value of DataTable shops
here.
I am learning about lambda expressions, so just for learning purposes, I want to know if this code can be shortened while using lambda expressions.
combobox.Text
nearGetTableFromDatabase
can be optimized – Snowbear Jun 14 '11 at 18:06