Oracle 5.0 Reference Manual page 1816

Table of Contents

Advertisement

MyCommand.CommandText =
Console.WriteLine("Total Rows:" +
//Fetch
MyCommand.CommandText = "SELECT * FROM my_odbc_net";
OdbcDataReader MyDataReader;
MyDataReader =
while (MyDataReader.Read())
//Close all resources
MyDataReader.Close();
MyConnection.Close();
}
catch (OdbcException MyOdbcException) //Catch any ODBC exception ..
{
for (int i=0; i < MyOdbcException.Errors.Count; i++)
}
}
}
}
20.1.5.7.2.2. Using Connector/ODBC with ODBC.NET and Visual Basic
The following sample creates a table
' @sample
' @purpose
' @author
'
' (C) Copyright MySQL AB, 1995-2006
'
'
'
' build command
'
' vbc /target:exe
'
/out:myvb.exe
'
/r:Microsoft.Data.Odbc.dll
'
/r:System.dll
'
/r:System.Data.dll
'
Imports Microsoft.Data.Odbc
Imports System
Connector/ODBC Examples
"SELECT COUNT(*) as TRows FROM my_odbc_net";
MyCommand.ExecuteScalar());
MyCommand.ExecuteReader();
{
if(string.Compare(MyConnection.Driver,"myodbc3.dll") == 0) {
//Supported only by Connector/ODBC 3.51
Console.WriteLine("Data:" + MyDataReader.GetInt32(0) + " " +
}
else {
//BIGINTs not supported by Connector/ODBC
Console.WriteLine("Data:" + MyDataReader.GetInt32(0) + " " +
}
}
{
Console.Write("ERROR #" + i + "\n" +
"Message: " +
MyOdbcException.Errors[i].Message + "\n" +
"Native: " +
MyOdbcException.Errors[i].NativeError.ToString() + "\n" +
"Source: " +
MyOdbcException.Errors[i].Source + "\n" +
"SQL: " +
MyOdbcException.Errors[i].SQLState + "\n");
}
: myvb.vb
: Demo sample for ODBC.NET using Connector/ODBC
: Venu,
<myodbc@lists.mysql.com>
MyDataReader.GetString(1) + " " +
MyDataReader.GetInt64(2));
MyDataReader.GetString(1) + " " +
MyDataReader.GetInt32(2));
and demonstrates the use in VB.
my_vb_net
1796

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents