RDBPROD: ASP.NET GridView Does Not Display the Correct Data Using ORDT (Doc ID 1323078.1)

Last updated on AUGUST 12, 2016

Applies to:

Oracle Rdb Server on OpenVMS - Version 7.3 to 7.3.2.0 [Release 7.3]
Oracle Rdb Developer Tools for Visual Studio - Version 7.3 to 7.3.2.0 [Release 7.3]
Information in this document applies to any platform.

Symptoms

When using an RdbDataReader as the data source for an ASP.NET GridView, it displays the GridView properties repeated for the number of rows the query returns rather than the actual data returned by the query.

C# code example:

using Oracle.DataAccess.RdbClient;
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
   {
    try
    {
      RdbConnection conn = new RdbConnection();
      conn.ConnectionString = "User Id=username;Password=topsecret;" +   
                              "Server=servername:servicename";
      conn.Open();
      RdbCommand cmd = new RdbCommand(" select * from test ", conn);
      RdbDataReader reader = cmd.ExecuteReader();
      GridView1.DataSource = reader;
      GridView1.DataBind();
    }
   catch (RdbException ex)
   {
   }
  }
}

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms