Ciao a tutti...
creo un dataset di ritorno da una query e me lo crea correttamente.
[TRACCIATURA DEL MIO LOG]
nome colonna: ID_LOCAZIONE
valore:P.01.19.5
nome colonna: ID_SKU
valore:RRIT9686
nome colonna: DS_SKU
valore:BUSTINA CREMA VISO RISTRUTTURANTE NOTTE
nome colonna: DS_LOTTO
valore:L08D8
nome colonna: QT_TOTALE
valore:12,000
nome colonna: DT_PRODUZIONE
valore:24/09/2007 0.00.00
nome colonna:stato
valore:
IL PROBLEMA è IL CAMPO STATO: che è un campo aggiunto
returnDs_Secondario.Tables[0].Columns.Add("stato", typeof(string));
DOPODICHE VORREI VALORIZZARLO:
returnDs_Secondario.Tables[0].Rows[j].ItemArray[6] = "X";
Però come si vede dal log quel campo rimane sempre vuoto.
db.connectDb();
DataSet returnDs_Secondario = db.sqlCommandSelect(query);
db.closeDbConn();
if ((returnDs_Secondario != null) && (returnDs_Secondario.Tables[0] != null) && (returnDs_Secondario.Tables[0].Rows.Count != 0))
{
logger.Logga("getIntTrack: dati recuperati dal db");
logger.Logga("righe trovate:" + returnDs_Secondario.Tables[0].Rows.Count.ToString());
returnDs_Secondario.Tables[0].Columns.Add("stato", typeof(string));
for (int j = 0; j < returnDs_Secondario.Tables[0].Rows.Count; j++) {
returnDs_Secondario.Tables[0].Rows[j].ItemArray[6] = "X";
for(int k = 0; k < returnDs_Secondario.Tables[0].Columns.Count;k++){
logger.Logga("nome colonna:" + returnDs_Secondario.Tables[0].Columns[k].ColumnName.ToString());
logger.Logga("valore colonna:" + returnDs_Secondario.Tables[0].Rows[j].ItemArray[k]);
}
returnDs.Tables[0].ImportRow(returnDs_Secondario.Tables[0].Rows[j]);
}
}