Start New Discussion within our Software Development Community

Dear Friends,

Here I have tried to connect to Sybase Adaptive Server Anywhere 7.0 with the following code in C# as console application,
I am getting the ERROR: System.NullReference Exception occured in , this code executed after running the asademo.

Can you help me out where exactly I am going wrong!!!!!!

using System;
using System.Data;
using System.Data.OleDb;

namespace SybaseConnect
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
            // TODO: Add code to start application here
            OleDbConnection myConnection =  new OleDbConnection(
            //open the connection
            //Creating command object.
            OleDbCommand myCommand = myConnection.CreateCommand();
            //Specify query
            myCommand.CommandText = "Select fname, lname from Customer";
            //DataReader for the command
            OleDbDataReader myDataReader = myCommand.ExecuteReader();
            //Let's display data
            while ( myDataReader.Read())


================================================ :)

This article has been dead for over six months. Start a new discussion instead.