Hi all,
I am trying to do the following:
I have a db column that stores xml inside
I want to create one dataset for each field with xml ( this means that I
don't know how many datasets I will have...) anyway I had a great idea, and
array of datasets, but it's not working...here is the code:
OdbcCommand oCmd = new OdbcCommand("SELECT * FROM tb_s57_terminals WHERE
class = 7",oConn);
OdbcDataReader dr;
oCmd.Connection.Open();
dr = oCmd.ExecuteReader();
DataSet[] dsUpdate = new DataSet[nTerminals];
int i = 0;
while (dr.Read())
{
try
{
using (StringReader sr = new StringReader(dr.GetString(4)))
{
dsUpdate[i].ReadXml(sr);
}
}
catch(Exception exc)
{
}
i++;
}
oCmd.Connection.Close();
the var nTerminals is a count to the fields on the database that have class
4...
The problem is an object reference not set to an instance of an object....
It catchs it on the try.... can someone tell me why?