none
No data exists for the row/column

    Question

  • Hi all,

    I had a question.Whenever the program execute the statement

    string ServerStatus1 = reader1.GetString(1);

    it will give me the  abovementioned error. But I had query the statement without any problem from Oracle database. Does anyone know what is the problem? Thanks

    String strSelect = "select ServerID, ServerStatus, LastUpdatedTime from ieiserverstatus where ServerID = '" + ServerName + "' order by LastUpdatedTime desc limit 1";

    try

    {

    string connection = "DRIVER={MySQL ODBC 3.51 Driver};" +

    "SERVER=" + HostName + ";" +

    "DATABASE=" + Database + ";" +

    "UID=" + UID + ";" +

    "PASSWORD=password;" +

    "OPTION=3";

    OdbcConnection conn = new OdbcConnection(connection);

    OdbcCommand cmd = new OdbcCommand(strSelect);

    cmd.Connection = conn;

    // Open connection

    conn.Open();

    OdbcDataReader reader1 = cmd.ExecuteReader();

    string ServerStatus1 = reader1.GetString(1);

    string LastUpdatedTime = reader1.GetString(2);

    reader1.Close();

    conn.Close();

    Friday, June 02, 2006 8:43 AM

Answers

All replies