Hello Shers,
You can set a list of all tables and make a loop to search in them one by one.
Here are some tips for doing so, If it doesn't help, Let me know.
- Here you can get the names of all tables in a DataTable
DataTable t = _conn.GetSchema("Tables");
- Then declare a DataTable DT and fill it with each table, one by one and search in each as follows:
-----------------------------------------------------------------------------
String X = ... ; //Where x= the compared value you're searching for.
DataTable DT = new DataTable();
// fill the datatable with data
DT = [your function to get the data]
//Now here's how you search in each record in the DataTable
for (int i = 0; i < DT.Rows.Count; i++)
{
// DT.Rows[i] Where 'i' is the vertical position of the counter in the DT record set
// .ToString() is written because DR.Rows[][] returns an object not a string.
if(DT.Rows["i"]["ColumnName"].ToString() == X)
{
found.
}
}
--------------------------------------------------------------------------------------
That was a pseudocode like. If you cant implement the previous code, please send me the solution file and Ill help you.
Regards.
Amr Mohallel
University of Sunderland
Faculty of Applied Sciences - Applied Business Computing