if (_dt.Rows.Count > 0)
{
foreach (DataRow row in _dt.Rows)
{
pUsername = row["tUsername"] == DBNull.Value ? " " : row["tUsername"].ToString();
pDomain = row["tDomain"] == DBNull.Value ? " " : row["tDomain"].ToString();
pStatus = row["tStatus"] == DBNull.Value ? 0 : Convert.ToInt32(row["tStatus"].ToString());
// pAdmin = (bool)row["tInstallType"];
}
}
How can i read different types from datatable ?Do i have to go each time to string ? . Why can't i read as type integer from database ? I think the main problem is row["tStatus"].ToString()