Hi, I wants to read data from a datatable, but after I executes the program it does not output anything. Can help me check what is the problem?
string SQLStr;
string output="";
SQLClass Access_Db = new SQLClass();
AccessDbCmd AccessDb_Cmd = new AccessDbCmd();
try
{
Access_Db.OpenTransaction();
Access_Db.BeginTransaction();
DataTable myTable = new DataTable();
ScannedPartNoTbl,FautyScanTbl";
SQLStr = "SELECT * FROM ScannedPartNoTbl";
myTable = AccessDb_Cmd.RetrieveData(SQLStr, Access_Db).Tables[0];
string[] array = new string [20];
int i=0;
foreach (DataRow row in myTable.Rows)
{
array[i] = (string)row["SerialNo"];
output += array[i] + "\n";
i++;
}
Console.WriteLine(output);
}
catch (Exception ex)
{
//event
}
finally
{
Access_Db.CloseTransaction();
}
}