Error TypedDataSet and OracleReader
Posted: Tue 03 May 2011 17:34
I have the following code that does not work:
and this one that does work
the object sistema is a TypedDataSet and MalTo is a TypedDataTable. The problem is that the OracleReader is not using the fieldName in the DataTable and is instead using the FieldNames (wich do not mach the datatable)
Code: Select all
OracleCommand cmd = new OracleCommand("SELECT TO_MAIL, TO_DISPLAY_NAME , ID_MAIL, ID_MAIL_TO, ENVIADO, REINTENTAR, ID_CONTACTO FROM SISTEMA.MAIL_TO");
cmd.Connection = conn.GetOracleConnection();
cmd.Connection.Open();
var reader = cmd.ExecuteReader();
this.sistema.MailTo.Load(reader);
cmd.Connection.Close();
return sistema.MailTo;
Code: Select all
OracleCommand cmd = new OracleCommand("SELECT TO_MAIL TOMAIL, TO_DISPLAY_NAME TODISPLAYNAME , ID_MAIL IDMAIL, ID_MAIL_TO IDMAILTO, ENVIADO, REINTENTAR, ID_CONTACTO IDCONTACTO FROM SISTEMA.MAIL_TO");
cmd.Connection = conn.GetOracleConnection();
cmd.Connection.Open();
var reader = cmd.ExecuteReader();
this.sistema.MailTo.Load(reader);
cmd.Connection.Close();
return sistema.MailTo;