and it loads very slow to my datagridview. The adminno is also not in the format i want as its only showing 1 adminno per line.
How to i achieve the result expected and speed up loading time into datagridview?
anyone help me with the codes?
THANKS!

1)All Your code processing is done on the backend iteself, I mean the filtering and joining.Instead of doing that try to populate all the records in the datatables. Then try to compare the necessary data from the datatable. and for joining (the main aspect) try to do it using the below format

ds.Tables[0].Rows[0][0].ToString();

In order to join all necessary data,

=>Use a for loop to execute till the end of the table.

=> Inside for loop use if condition to check for conflict

if(ds.Tables[0].Rows[0][0].ToString())=(ds.Tables[0].Rows[0][0].ToString())
{
//Do the following
//here u use this on a different datatable***avoid that***
}

dim curadminno as string = string.empty
'retrieve modulecode from datatable1
for each dr1 as datarow in dt1.rows
curadminno = dr1("AdminNo").tostring
'loop through datatable3 to look for matching adminno
for i as integer = 0 to dt3.rows.count -1
if curadminno = dt3(I).tostring then
'Dont know how to continue

String[] admin_no = new String[];
int i=0;
for each dr1 as datarow in dt1.rows
if(curadminno = dr1("AdminNo").tostring)
{
admin_no[i]=curadminno;
}
//end the loop and necessary functionalities
then populate it as
dim dt3 as new datatable;
for each i in admin_no[i]
dt3.row.add(admin_no[i])