<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – C#</title>
    <link>/en/connecting-to/client-libraries/accessing/c/</link>
    <description>Recent content in C# on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/connecting-to/client-libraries/accessing/c/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Connecting-To: ADO.NET data types</title>
      <link>/en/connecting-to/client-libraries/accessing/c/ado-net-data-types/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/ado-net-data-types/</guid>
      <description>
        
        
        &lt;p&gt;This table details the mapping between OpenText™ Analytics Database data types and .NET and ADO.NET data types.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
.NET Framework Type&lt;/th&gt; 

&lt;th &gt;
ADO.NET DbType&lt;/th&gt; 

&lt;th &gt;
VerticaType&lt;/th&gt; 

&lt;th &gt;
OpenText™ Analytics Database Data Type&lt;/th&gt; 

&lt;th &gt;
VerticaDataReader getter&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Boolean&lt;/td&gt; 

&lt;td &gt;


Boolean&lt;/td&gt; 

&lt;td &gt;


Bit&lt;/td&gt; 

&lt;td &gt;


Boolean&lt;/td&gt; 

&lt;td &gt;


GetBoolean()&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


byte[]&lt;/td&gt; 

&lt;td &gt;


Binary&lt;/td&gt; 

&lt;td &gt;






&lt;p&gt;Binary&lt;/p&gt;
&lt;p&gt;VarBinary&lt;/p&gt;
&lt;p&gt;LongVarBinary&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;






&lt;p&gt;Binary&lt;/p&gt;
&lt;p&gt;VarBinary&lt;/p&gt;
&lt;p&gt;LongVarBinary&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;









&lt;p&gt;GetBytes()&lt;/p&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;
&lt;p&gt;The limit for LongVarBinary is 32 Million bytes. If you attempt to insert more than the limit during a batch transfer for any one row, then they entire batch fails. Verify the size of the data before attempting to insert a LongVarBinary during a batch.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Datetime&lt;/td&gt; 

&lt;td &gt;


DateTime&lt;/td&gt; 

&lt;td &gt;






&lt;p&gt;Date&lt;/p&gt;
&lt;p&gt;Time&lt;/p&gt;
&lt;p&gt;TimeStamp&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;






&lt;p&gt;Date&lt;/p&gt;
&lt;p&gt;Time&lt;/p&gt;
&lt;p&gt;TimeStamp&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;









&lt;p&gt;GetDateTime()&lt;/p&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;
&lt;p&gt;The Time portion of the DateTime object for database dates is set to DateTime.MinValue. Previously, VerticaType.DateTime was used for all date/time types. VerticaType.DateTime still exists for backwards compatibility, but now there are more specific VerticaTypes for each type.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


DateTimeOffset&lt;/td&gt; 

&lt;td &gt;


DateTimeOffset&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;TimestampTZ&lt;/p&gt;
&lt;p&gt;TimeTZ&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;TimestampTZ&lt;/p&gt;
&lt;p&gt;TimeTZ&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;









&lt;p&gt;GetDateTimeOffset()&lt;/p&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;
&lt;p&gt;The Date portion of the DateTime is set to DateTime.MinValue&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Decimal&lt;/td&gt; 

&lt;td &gt;


Decimal&lt;/td&gt; 

&lt;td &gt;


Numeric&lt;/td&gt; 

&lt;td &gt;


Numeric&lt;/td&gt; 

&lt;td &gt;


GetDecimal()&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Double&lt;/td&gt; 

&lt;td &gt;


Double&lt;/td&gt; 

&lt;td &gt;


Double&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;Double&lt;/p&gt;
&lt;p&gt;Precision&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;









&lt;p&gt;GetDouble()&lt;/p&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;
&lt;p&gt;The Double type uses a default precision of 53.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Int64&lt;/td&gt; 

&lt;td &gt;


Int64&lt;/td&gt; 

&lt;td &gt;


BigInt&lt;/td&gt; 

&lt;td &gt;


Integer&lt;/td&gt; 

&lt;td &gt;


GetInt64()&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


TimeSpan&lt;/td&gt; 

&lt;td &gt;


Object&lt;/td&gt; 

&lt;td &gt;


13 Interval Types&lt;/td&gt; 

&lt;td &gt;


13 Interval Types&lt;/td&gt; 

&lt;td &gt;









&lt;p&gt;GetInterval()&lt;/p&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;
&lt;p&gt;There are 13 VerticaType values for the 13 types of intervals. The specific VerticaType used determines the conversion rules that the driver applies. Year/Month intervals represented as 365/30 days&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


String&lt;/td&gt; 

&lt;td &gt;


String&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;Varchar&lt;/p&gt;
&lt;p&gt;LongVarChar&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;Varchar&lt;/p&gt;
&lt;p&gt;LongVarChar&lt;/p&gt;
&lt;/td&gt; 

&lt;td &gt;


GetString()&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


String&lt;/td&gt; 

&lt;td &gt;


StringFixedLengt&lt;/td&gt; 

&lt;td &gt;


Char&lt;/td&gt; 

&lt;td &gt;


Char&lt;/td&gt; 

&lt;td &gt;


GetString()&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Guid&lt;/td&gt; 

&lt;td &gt;
Guid&lt;/td&gt; 

&lt;td &gt;
UUID (&lt;a href=&#34;#UUID_Backwards_Compatibility&#34;&gt;see note below&lt;/a&gt;)&lt;/td&gt; 

&lt;td &gt;
UUID&lt;/td&gt; 

&lt;td &gt;


GetGuid()&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


Object&lt;/td&gt; 

&lt;td &gt;


Object&lt;/td&gt; 

&lt;td &gt;


N/A&lt;/td&gt; 

&lt;td &gt;


N/A&lt;/td&gt; 

&lt;td &gt;


GetValue()&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;UUID_Backwards_Compatibility&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;uuid-backwards-compatibility&#34;&gt;UUID backwards compatibility&lt;/h2&gt;
&lt;p&gt;Vertica version 9.0.0 introduced the UUID data type, including JDBC support for UUIDs. The Vertica ADO.NET, ODBC, and OLE DB clients added full support for UUIDs in version 9.0.1. OpenText™ Analytics Database maintains backwards compatibility with older &lt;a href=&#34;../../../../../en/connecting-to/client-libraries/client-driver-and-server-version-compatibility/&#34;&gt;supported&lt;/a&gt; client driver versions that do not support the UUID data type, as follows:

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
When an older client...&lt;/th&gt; 

&lt;th &gt;
OpenText™ Analytics Database...&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Queries tables with UUID columns&lt;/td&gt; 

&lt;td &gt;
Translates the native UUID values to CHAR values.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Inserts data into a UUID column&lt;/td&gt; 

&lt;td &gt;
Converts the CHAR value sent by the client into a native UUID value.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
Queries a UUID column&#39;s metadata&lt;/td&gt; 

&lt;td &gt;
Reports its data type as CHAR.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;


      </description>
    </item>
    
    <item>
      <title>Connecting-To: Setting the locale for ADO.NET sessions</title>
      <link>/en/connecting-to/client-libraries/accessing/c/setting-locale-ado-net-sessions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/setting-locale-ado-net-sessions/</guid>
      <description>
        
        
        &lt;ul&gt;
&lt;li&gt;
&lt;p&gt;ADO.NET applications use a UTF-16 character set encoding and are responsible for converting any non-UTF-16 encoded data to UTF-16. The same cautions as for ODBC apply if this encoding is violated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The ADO.NET driver converts UTF-16 data to UTF-8 when passing to the OpenText™ Analytics Database server and converts data sent by the database server from UTF-8 to UTF-16.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ADO.NET applications should set the correct server session locale by executing the &lt;a href=&#34;../../../../../en/sql-reference/statements/set-statements/set-locale/&#34;&gt;SET LOCALE TO&lt;/a&gt; command in order to get expected collation and string functions behavior on the server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If there is no default session locale at the database level, ADO.NET applications need to set the correct server session locale by executing the &lt;a href=&#34;../../../../../en/sql-reference/statements/set-statements/set-locale/&#34;&gt;SET LOCALE TO&lt;/a&gt; command in order to get expected collation and string functions behavior on the server. See the &lt;a href=&#34;../../../../../en/sql-reference/statements/set-statements/set-locale/#&#34;&gt;SET LOCALE&lt;/a&gt; command.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Connecting to the database</title>
      <link>/en/connecting-to/client-libraries/accessing/c/connecting-to-db/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/connecting-to-db/</guid>
      <description>
        
        
        
      </description>
    </item>
    
    <item>
      <title>Connecting-To: Querying the database using ADO.NET</title>
      <link>/en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/</guid>
      <description>
        
        
        &lt;p&gt;This section describes how to create queries to do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/inserting-data-ado-net/&#34;&gt;Inserting data into the database&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/reading-data-ado-net/&#34;&gt;Read data from the database&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/c/querying-db-using-ado-net/loading-data-through-ado-net/streaming-data-via-ado-net/&#34;&gt;Load data into the database&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The ExecuteNonQuery() method used to query the database returns an int32 with the number of rows affected by the query. The maximum size of an int32 type is a constant and is defined to be 2,147,483,547. If your query returns more results than the int32 max, then ADO.NET throws an exception because of the overflow of the int32 type. However the query is still processed by the database even when the reporting of the return value fails. This is a limitation in .NET, as ExecuteNonQuery() is part of the standard ADO.NET interface.

&lt;/div&gt;

      </description>
    </item>
    
    <item>
      <title>Connecting-To: Canceling ADO.NET queries</title>
      <link>/en/connecting-to/client-libraries/accessing/c/canceling-ado-net-queries/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/canceling-ado-net-queries/</guid>
      <description>
        
        
        &lt;p&gt;You can cancel a running vsql query by calling the &lt;code&gt;.Cancel()&lt;/code&gt; method of any Command object. The &lt;code&gt;SampleCancelTests&lt;/code&gt; class demonstrates how to cancel a query after reading a specified number of rows. It implements the following methods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SampleCancelTest()&lt;/code&gt; executes the &lt;code&gt;Setup()&lt;/code&gt; function to create a test table. Then, it calls &lt;code&gt;RunQueryAndCancel()&lt;/code&gt; and &lt;code&gt;RunSecondQuery()&lt;/code&gt; to demonstrate how to cancel a query after it reads a specified number of rows. Finally, it runs the &lt;code&gt;Cleanup()&lt;/code&gt; function to drop the test table.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Setup()&lt;/code&gt; creates a database for the example queries.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Cleanup()&lt;/code&gt; drops the database.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RunQueryAndCancel()&lt;/code&gt; reads exactly 100 rows from a query that returns more than 100 rows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RunSecondQuery()&lt;/code&gt; reads all rows from a query.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;using System;
using Vertica.Data.VerticaClient;

class SampleCancelTests
{
    // Creates a database table, executes a query that cancels during a read loop,
    // executes a query that does not cancel, then drops the test database table.
    // connection: A connection to an OpenText&amp;amp;trade; Analytics Database.

    public static void SampleCancelTest(VerticaConnection connection)
    {
        VerticaCommand command = connection.CreateCommand();

        Setup(command);

        try
        {
            Console.WriteLine(&amp;#34;Running query that will cancel after reading 100 rows...&amp;#34;);
            RunQueryAndCancel(command);
            Console.WriteLine(&amp;#34;Running a second query...&amp;#34;);
            RunSecondQuery(command);
            Console.WriteLine(&amp;#34;Finished!&amp;#34;);
        }
        finally
        {
            Cleanup(command);
        }
    }

    // Set up the database table for the example.
    // command: A Command object used to execute the query.
    private static void Setup(VerticaCommand command)
    {
        // Create table used for test.
        Console.WriteLine(&amp;#34;Creating and loading table...&amp;#34;);
        command.CommandText = &amp;#34;DROP TABLE IF EXISTS adocanceltest&amp;#34;;
        command.ExecuteNonQuery();
        command.CommandText = &amp;#34;CREATE TABLE adocanceltest(id INTEGER, time TIMESTAMP)&amp;#34;;
        command.ExecuteNonQuery();
        command.CommandText = @&amp;#34;INSERT INTO adocanceltest
        SELECT row_number() OVER(), slice_time
            FROM(
                    SELECT slice_time FROM(
                    SELECT &amp;#39;2021-01-01&amp;#39;::timestamp s UNION ALL SELECT &amp;#39;2022-01-01&amp;#39;::timestamp s
                    ) sq TIMESERIES slice_time AS &amp;#39;1 second&amp;#39; OVER(ORDER BY s)
            ) sq2&amp;#34;;
        command.ExecuteNonQuery();
    }

    // Clean up the database after running the example.
    // command: A Command object used to execute the query.
    private static void Cleanup(VerticaCommand command)
    {
        command.CommandText = &amp;#34;DROP TABLE IF EXISTS adocanceltest&amp;#34;;
        command.ExecuteNonQuery();
    }

    // Execute a query that returns many rows and cancels after reading 100.
    // command: A Command object used to execute the query.
    private static void RunQueryAndCancel(VerticaCommand command)
    {
        command.CommandText = &amp;#34;SELECT COUNT(id) from adocanceltest&amp;#34;;
        int fullRowCount = Convert.ToInt32(command.ExecuteScalar());

        command.CommandText = &amp;#34;SELECT id, time FROM adocanceltest&amp;#34;;
        VerticaDataReader dr = command.ExecuteReader();
        int nCount = 0;
        try
        {
            while (dr.Read())
            {
                nCount++;
                if (nCount == 100)
                {
                    // After reaching 100 rows, cancel the command
                    // Note that it is not necessary to read the remaining rows
                    command.Cancel();
                    return;
                }
            }
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
        finally
        {
            dr.Close();
            // Verify that the cancel stopped the query
            Console.WriteLine((fullRowCount - nCount) + &amp;#34; rows out of &amp;#34; + fullRowCount + &amp;#34; discarded by cancel&amp;#34;);
        }
    }

    // Execute a simple query and read all results.
    // command: A Command object used to execute the query.
    private static void RunSecondQuery(VerticaCommand command)
    {
        command.CommandText = &amp;#34;SELECT 1 FROM dual&amp;#34;;
        VerticaDataReader dr = command.ExecuteReader();
        try
        {
            while (dr.Read())
            {
                ;
            }
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
            Console.WriteLine(&amp;#34;Warning: no exception should be thrown on query after cancel&amp;#34;);
        }
        finally
        {
            dr.Close();
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Connecting-To: Handling messages</title>
      <link>/en/connecting-to/client-libraries/accessing/c/handling-messages/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/handling-messages/</guid>
      <description>
        
        
        &lt;p&gt;You can capture info and warning messages that OpenText™ Analytics Database provides to the ADO.NET driver by using the InfoMessage event on the VerticaConnection delegate class. This class captures messages that are not severe enough to force an exception to be triggered, but might still provide information that can benefit your application.&lt;/p&gt;
&lt;h2 id=&#34;to-use-the-verticainfomessageeventhander-class&#34;&gt;To use the VerticaInfoMessageEventHander class:&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a method to handle the message sent from the even handler:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;static void conn_InfoMessage(object sender, VerticaInfoMessageEventArgs e)
{
    Console.WriteLine(e.SqlState + &amp;#34;: &amp;#34; + e.Message);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/c/connecting-to-db/opening-and-closing-db-connection-ado-net/&#34;&gt;connection&lt;/a&gt; and register a new VerticaInfoMessageHandler delegate for the InfoMessage event:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_conn.InfoMessage += new VerticaInfoMessageEventHandler(conn_InfoMessage);
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Execute your queries. If a message is generated, then the event handle function is run.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can unsubscribe from the event with the following command:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_conn.InfoMessage -= new VerticaInfoMessageEventHandler(conn_InfoMessage);
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Vertica.Data.VerticaClient;
namespace ConsoleApplication {
  class Program {
    // define message handler to deal with messages
    static void conn_InfoMessage(object sender, VerticaInfoMessageEventArgs e) {
      Console.WriteLine(e.SqlState + &amp;#34;: &amp;#34; + e.Message);
    }
    static void Main(string[] args) {
      //configure connection properties
      VerticaConnectionStringBuilder builder = new VerticaConnectionStringBuilder();
      builder.Host = &amp;#34;192.168.1.10&amp;#34;;
      builder.Database = &amp;#34;VMart&amp;#34;;
      builder.User = &amp;#34;dbadmin&amp;#34;;

      //open the connection
      VerticaConnection _conn = new VerticaConnection(builder.ToString());
      _conn.Open();

      //create message handler instance by subscribing it to the InfoMessage event of the connection
      _conn.InfoMessage += new VerticaInfoMessageEventHandler(conn_InfoMessage);

      //create and execute the command
      VerticaCommand cmd = _conn.CreateCommand();
      cmd.CommandText = &amp;#34;drop table if exists fakeTable&amp;#34;;
      cmd.ExecuteNonQuery();

      //close the connection
      _conn.Close();
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This examples displays the following when run:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;00000: Nothing was dropped
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Connecting-To: Getting table metadata</title>
      <link>/en/connecting-to/client-libraries/accessing/c/getting-table-metadata/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/connecting-to/client-libraries/accessing/c/getting-table-metadata/</guid>
      <description>
        
        
        &lt;p&gt;You can get the table metadata by using the GetSchema() method on a connection and loading the metadata into a DataTable:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;database_name&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;schema_name&lt;/code&gt;&lt;/em&gt;, and &lt;em&gt;&lt;code&gt;table_name&lt;/code&gt;&lt;/em&gt; can be set to &lt;code&gt;null&lt;/code&gt;, a specific name, or use a LIKE pattern.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;table_type&lt;/code&gt;&lt;/em&gt; can be one of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;SYSTEM TABLE&amp;quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;TABLE&amp;quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;GLOBAL TEMPORARY&amp;quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;LOCAL TEMPORARY&amp;quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;quot;VIEW&amp;quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;null&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If &lt;em&gt;&lt;code&gt;table_type&lt;/code&gt;&lt;/em&gt; is &lt;code&gt;null&lt;/code&gt;, then the metadata for all metadata tables is returned.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DataTable table = _conn.GetSchema(&amp;#34;Tables&amp;#34;, new string[] { null, null, null, &amp;#34;SYSTEM TABLE&amp;#34; });
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Vertica.Data.VerticaClient;
namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            // configure connection properties
            VerticaConnectionStringBuilder builder = new VerticaConnectionStringBuilder();
            builder.Host = &amp;#34;192.168.1.10&amp;#34;;
            builder.Database = &amp;#34;VMart&amp;#34;;
            builder.User = &amp;#34;dbadmin&amp;#34;;

            // open the connection
            VerticaConnection _conn = new VerticaConnection(builder.ToString());
            _conn.Open();

            // create a new data table containing the schema
            // the last argument can be &amp;#34;SYSTEM TABLE&amp;#34;, &amp;#34;TABLE&amp;#34;, &amp;#34;GLOBAL TEMPORARY&amp;#34;,
            // &amp;#34;LOCAL TEMPORARY&amp;#34;, &amp;#34;VIEW&amp;#34;, or null for all types
            DataTable table = _conn.GetSchema(&amp;#34;Tables&amp;#34;, new string[] { null, null, null, &amp;#34;SYSTEM TABLE&amp;#34; });

            // print out the schema
            foreach (DataRow row in table.Rows) {
                foreach (DataColumn col in table.Columns)
                {
                    Console.WriteLine(&amp;#34;{0} = {1}&amp;#34;, col.ColumnName, row[col]);
                }
                Console.WriteLine(&amp;#34;============================&amp;#34;);
            }

            //close the connection
            _conn.Close();
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
