System.IndexOutOfRangeException: Cannot find table 0.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramanan ram
    New Member
    • Feb 2012
    • 26

    #1

    System.IndexOutOfRangeException: Cannot find table 0.

    hi..

    here,i am getting
    System.IndexOut OfRangeExceptio n: Cannot find table 0.this
    error.

    coding:
    Code:
     OleDbConnection conn1 = new OleDbConnection(conn);
                conn1.Open();
                string sql = "SAMPLEPROCEDURE";
                OleDbCommand dbcomm = new OleDbCommand(sql, conn1);
                dbcomm.CommandType = CommandType.StoredProcedure;
                dbcomm.Parameters.Add("P_SUPPVALUE", OleDbType.VarChar, 200).Value = suppvalue.Text;
                OleDbDataAdapter ole = new OleDbDataAdapter(dbcomm);
                DataSet ds1 = new DataSet();
                ole.Fill(ds1);
                string value = ds1.Tables[0].Rows[0]["a"].ToString();
    last line affect this program ,now i need a value to be store the variable of value.a is an stored procedure table field using...
    please help..
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Your fill didn't retrieve any data, so there is no table at that index.

    Make sure that your query and connections are correct.

    -Frinny

    Comment

    Working...