Oracle 5.0 Reference Manual page 1921

Table of Contents

Advertisement

using MySql.Data.MySqlClient;
namespace ConsoleApplication2
{
class Program
{
private static void DisplayData(System.Data.DataTable table)
{
foreach (System.Data.DataRow row in table.Rows)
{
}
}
static void Main(string[] args)
{
string connStr = "server=localhost;user=root;database=world;port=3306;password=******;";
MySqlConnection conn = new MySqlConnection(connStr);
try
{
}
catch (Exception ex)
{
}
Console.WriteLine("Done.");
}
}
}
Further information on the
Microsoft .NET
20.2.5.3. Using MySqlCommand
A
MySqlCommand
CommandText
can be one of:
1. Text - A SQL text command (default)
2. StoredProcedure - The name of a Stored Procedure
3. TableDirect - The name of a table (new in Connector/Net 6.2)
The default CommandType, Text, is used for executing queries and other SQL commands. Some
example of this can be found in the following section
If
CommandType
to access.
If
CommandType
when you call one of the Execute methods. In effect, this command performs a
Connector/Net Programming
foreach (System.Data.DataColumn col in table.Columns)
{
Console.WriteLine("{0} = {1}", col.ColumnName, row[col]);
}
Console.WriteLine("============================");
Console.WriteLine("Connecting to MySQL...");
conn.Open();
DataTable table = conn.GetSchema("MetaDataCollections");
//DataTable table = conn.GetSchema("UDF");
DisplayData(table);
conn.Close();
Console.WriteLine(ex.ToString());
GetSchema()
documentation.
has the
CommandText
will be handled differently depending on the setting of CommandType.
is set to StoredProcedure, set
is set to TableDirect, all rows and columns of the named table will be returned
method and schema collections can be found in the
and
properties associated with it. The
CommandType
Section 20.2.4.1.2, "The MySqlCommand
CommandText
1901
CommandType
to the name of the Stored Procedure
on the table
SELECT *
Object".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents