Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 79891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:13:01+00:00 2026-05-10T21:13:01+00:00

I am using ASP.NET 2.0 and VS 2005. I need to populate a grid

  • 0

I am using ASP.NET 2.0 and VS 2005. I need to populate a grid on an update panel from an Oracle refcursor after the user clicks a button. I have an example from another project, but it is pretty complicated. Is there an easy way to display the data in a grid in an updatepanel? We don’t want the data to be displayed when the tab is first opened, just after the user clicks a button.

TIA, Theresa

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:13:01+00:00Added an answer on May 10, 2026 at 9:13 pm

    I’m posting some code here because this stuff is hard to figure out and research. here’s one simple way to do it using the Microsoft Oracle Data Provider (I prefer ODP.NET):

    <%@ Page Language='C#' AutoEventWireup='true' %> <%@ Import Namespace='System.Data' %> <%@ Import Namespace='System.Data.OracleClient' %>  <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>  <html xmlns='http://www.w3.org/1999/xhtml'> <head runat='server'> <title>GridView w/ Oracle Ref Cursor</title> <style type='text/css'>     body {padding:25px;}     .Button1 {margin:35px 0;} </style> <script runat='server' type='text/C#'>     protected void Page_Load(object sender, EventArgs e) {     }      protected void Button1_Click(object sender, EventArgs e) {         var dataSet = new DataSet();         // get connection string from web.config         var connStr = ConfigurationManager.ConnectionStrings['ConnStr1'].ConnectionString;         // create connection         using (var conn = new OracleConnection(connStr)) {             // create & define the parameter             var refCursorParam = new OracleParameter();             refCursorParam.ParameterName = 'RET';             refCursorParam.OracleType = OracleType.Cursor;             refCursorParam.Direction = ParameterDirection.Output;             // create & define the command             var cmd = new OracleCommand();             cmd.CommandText = 'GET_ALL_EMPS';             cmd.CommandType = CommandType.StoredProcedure;             cmd.Parameters.Add(refCursorParam);             cmd.Connection = conn;             // use data adapter to fill dataset             using (var adapter = new OracleDataAdapter(cmd))                 adapter.Fill(dataSet);         }         // set some gridview properties         GridView1.AllowPaging = true;         GridView1.PageSize = 5;          // bind dataset to grid         GridView1.DataSourceID = null;         var dv = dataSet.Tables[0].AsDataView();         // save dataview to session so gridview can be re-bound later         Session['dataView'] = dv;         GridView1.DataSource = dv;         GridView1.DataBind();          pCount.InnerText = 'Total Row Count: ' + dataSet.Tables[0].Rows.Count.ToString();          // dispose of dataset         dataSet.Dispose();     }      void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) {         // get dataview from session         var dv = (DataView)Session['dataView'];         GridView1.DataSource = dv;         GridView1.PageIndex = e.NewPageIndex;         GridView1.DataBind(); // re-bind data     } </script> </head> <body> <form id='form1' runat='server'> <asp:ScriptManager ID='ScriptManager1' runat='server' /> <div>     <asp:UpdatePanel id='updatepanel1' runat='server'>         <ContentTemplate>             <asp:Button ID='Button1'                 runat='server'                 Text='Refresh GridView'                 OnClick='Button1_Click' />             <p id='pCount' runat='server' />             <asp:GridView ID='GridView1'                           runat='server'                           OnPageIndexChanging='GridView1_PageIndexChanging' />         </ContentTemplate>     </asp:UpdatePanel> </div> </form> </body> </html> 

    try this out and let me know if you have any questions. here’s some good references:

    • http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledataadapter.aspx
    • http://msdn.microsoft.com/en-us/library/0e39s2ck.aspx

    -gabe

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET 3.5 and jQuery UI. When a user clicks the Search button, a
I need to write a web application using SQL Server 2005, asp.net, and ado.net.
I maintain a legacy ASP.Net Web application (using .Net 2.0 + SQL Server 2005
Using ASP.NET MVC when trying to get the information stored on my Session[objectName] from
Using ASP.NET MVC + jQuery : I need to use some values owned by
I'm using sql-server 2005 and ASP.NET with C#. I have Users table with userId(int),
I need to link to a server side SSRS report from ASP.NET and pass
I am developing one web application using asp.net 2005 and Microsoft SQL Server 2008
I am running ASP.NET application written in C# and using SQL Server 2005. I
I am writing a web application using ASP.NET 2.0 [Visual Studio 2005 Professional Edition].

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.