Home All Groups Group Topic Archive Search About

ODBC DataAdapter -> Strongly Typed Datasets

Author
31 Jul 2006 2:14 PM
zackary.evans
I am having a problem using strongly typed datasets with the ODBC
dataAdapter. The main problem is that I am connectiong to an Informix
(IDS 10.0) database by calling a stored procedure. The procedure does
not return column names, so I cannot run the .Fill() method against the
procedure and obtain the proper results.

Instead of populating the columns I set up in the dataset, it makes up
its own columns (generic names) and tacks them onto the dataset as new
columns.

Basically my question is...can i set up some kind of mapping within
ADO.Net to allow the column names to be properly filled? How would I
accomplish this?

Thanks in advance!

Here is a snippet of the code im using:

<CODE>
                               TestInformix dataSet =
                                         new TestInformix();

                connectionString = "";

                OdbcConnection connection =
                    new OdbcConnection(connectionString);

                OdbcCommand command = connection.CreateCommand();
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "{call selFare_test3(?, ?)}";

                OdbcParameter param = new OdbcParameter();
                param.DbType = DbType.DateTime;
                param.Value = "2006-01-01 12:00:00";
                command.Parameters.Add(param);

                param = new OdbcParameter();
                param.DbType = DbType.DateTime;
                param.Value = "2006-01-01 12:00:00";
                command.Parameters.Add(param);

                OdbcDataAdapter adapter =
                    new OdbcDataAdapter(command);

                connection.Open();
                adapter.Fill(dataSet, "PricingView");
</CODE>

AddThis Social Bookmark Button