Metadata

This section deals briefly with metadata. Metadata is information that can be extracted from the result. The number of rows and the number of columns in a result set are good examples.

However, there's also some additional information available that can be useful. In the next example, we read the entire set of metadata provided by Mono and PostgreSQL:

 using System; using System.Data; using Mono.Data.PostgreSqlClient; class Demo { static void Main(string[] args) { PgSqlConnection cnc = new PgSqlConnection (); cnc.ConnectionString = "host=localhost;" + "dbname=test;user=hs"; cnc.Open(); IDbCommand comm = cnc.CreateCommand (); comm.CommandType = CommandType.Text; comm.CommandText = "SELECT id, data FROM t_data "; IDataReader dr; dr = comm.ExecuteReader(CommandBehavior.SingleResult); ...

Get Mono Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.