Data Replication 2
Results 1 to 2 of 2

Thread: AisDataReader.HasRows is always false.

  1. #1
    himanshugupta is offline Junior Member
    Join Date
    Jul 2009
    Posts
    2
    Rep Power
    0

    AisDataReader.HasRows is always false.

    For getting the data in the data reader, I am using the following statements in C#:

    AisCommand cmd = newAisCommand())
    cmd.CommandType =
    CommandType.StoredProcedure;
    cmd.CommandText = spName;
    cmd.Connection = conn;
    AisParameter p1 = newAisParameter();
    p1.Value = sortKey +
    "%";
    cmd.Parameters.Add(p1);

    AisDataReader
    objReader = cmd.ExecuteReader();

    I am getting results in the objReader, the problem is whenever checking for property "objReader.HasRows" of AisDataReader, it always returns false.

    "objReader.HasRows" always returns false whether the data is being returned or not.

    Is there some setting or extra step is to be done at the code level to get the correct value in the "HasRows" property of AisDataReader.


  2. #2
    Gadi.Farhat is offline Development Manager
    Join Date
    Mar 2009
    Posts
    255
    Rep Power
    11
    Hi Himan,

    Our query processor actually executes a query on the first call to get rows. The information on whether the DataReader has rows, in most cases, is not available before trying to read the first row. Therefore, this method is not supported and always returns false.

    You may change the code to check the Read method return value.


    Regards,

    Gadi
    To Find Out more About Attunity Technology:
    Attunity
    or:
    Contact Us

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •