Monday, July 11, 2011

How to filer the datatable using dataview using c#

Datatable dt = new Datatable ();
Datatable dtFilter = new Datatable ();OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
oleda.Fill(dt); //(Here you can Fill your datatable)
DataView dvRejFile = new DataView(dt);
//now you can filter the dataview using Row filter
// Column Name Value
dvRejFile1.RowFilter = "[Application No] <> '" + Pass your value+ "'";
// Assign your filter dataview to another datatable.
dtFilter = dvRejFile.ToTable();

Thursday, July 7, 2011

How to Read the Windows Form Names in c#

List GetFormNameList = new List();
Assembly asb = Assembly.GetExecutingAssembly();
foreach (Type type in asb.GetTypes())
{
if (type.BaseType.FullName.Equals("Common.UI.frmVirtual"))
{
GetFormNameList.Add(type.Name.ToString());
}
}