How about, I'm trying to print the total of a query count
in a label
, but when I call the result only prints a System.Data.DataRow
This is my query
/***********GET ALL THE FAKE TOOLS FROM FCH*************/
public class area_success_FCH
{
public DataTable Sfchconnect()
{
string myConnectionString = @"C:\Users\gutiece\Desktop\database\" + "Database1.accdb";
DataTable SfchTable = new DataTable();
OleDbConnection connection = new OleDbConnection();
OleDbCommand command = new OleDbCommand();
OleDbDataAdapter adapter = new OleDbDataAdapter();
DataSet dataset = new DataSet();
try
{
connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data source= " + myConnectionString;
bool ok = System.IO.File.Exists(myConnectionString);
String qry = "SELECT COUNT(*) FROM area WHERE standby = 1 AND area = 'FCH'";
command.Connection = connection;
command.CommandText = qry;
adapter.SelectCommand = command;
command.Connection.Open();
OleDbDataReader reader = command.ExecuteReader(); // close conn after
SfchTable.Load(reader);
if (!reader.IsClosed)
{
reader.Close();
}
return SfchTable;
}
catch (Exception)
{
}
return SfchTable;
}
}
/*******************************************************/
the query is in a folder called conexiones
and it has a class where it has the query
then the DataTable
I send it to call from the dashboard.aspx
that is a common page in the root file
/********************************FILL COUNT CLOUD******************************/
conexiones.area_success_FCH Sfchconnect = new conexiones.area_success_FCH();
conexiones.area_success_FCH SfchTable = new conexiones.area_success_FCH();
/******************************************************************************/
if (!IsPostBack)
{
Lbl_notu.Text = notu.Rows[0].ToString();