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

  • SEARCH
  • Home
  • 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 7441031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:56:45+00:00 2026-05-29T10:56:45+00:00

I have a sqldatareader spitting out SQL data on a page on page load

  • 0

I have a sqldatareader spitting out SQL data on a page on page load but I’d like to add functionality to have a jquery button click that refreshes the data to the user from a fresh set of results, without refreshing the entire page.

I’m a beginner though and having trouble figuring out where to begin with this.

I have the following DIV content in my ASPX

<div id="blockOver">
<% while (Reader.Read()) {
   string filename = Reader.GetString(1);
   string date = Reader.GetSqlDateTime(3).ToString();
   string filetype = Reader.GetString(4);
   Int32 height = (Int32)Reader.GetSqlInt32(5);
   Int32 width = (Int32)Reader.GetSqlInt32(6);
   string uploadGroup = Reader.GetString(7);
   string title = Reader.GetString(8);
   string uniqueID = Reader.GetString(9);
   string uploader = Reader.GetString(10);
   string uniqueIDnoExt = Reader.GetString(12);
%>
<div class="block">
    <a href="#t=<%= uniqueID %>" onmouseover="defaultJs.displayInfo ('<%= title %>', '<%= date %>', '<%= filetype %>', '<%= uniqueIDnoExt %>')" onclick="defaultJs.showFile('<%= title %>', '<%= date %>', '<%= filetype %>', '<%= uniqueIDnoExt %>', '<%= uniqueID %>')" onmouseout="defaultJs.hideInfo()">
    <img title="<%= title %>" src="thumbs/<%= uniqueIDnoExt %>.jpg" />
    </a>
</div>
<% } %>

and in my ASPX.CS I have:

public partial class _Default : System.Web.UI.Page
{
private SqlDataReader reader = null;
public SqlDataReader Reader { get { return reader; } set { reader = value; } }

    protected void Page_Load(object sender, EventArgs e)
    {
    string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
    SqlConnection connection = new SqlConnection(connectionString);
    connection.Open();

    SqlCommand command = new SqlCommand("SELECT * FROM uploads ORDER BY id DESC", connection);
    command.Parameters.Add(new SqlParameter("uploader", "anonymous"));

    Reader = command.ExecuteReader();
    }
}

this works for loading the data on page load, but what i’d like to do now is incorporate jquery/ajax to be able to refresh this data on jquery call, without it refreshing the entire page.

I’m not really sure where to begin with this, I’m sure it’s second nature for you guys, could anyone point me at some simple minded sources or provide some sample code? Really appreciate it thanks.

  • 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. Editorial Team
    Editorial Team
    2026-05-29T10:56:46+00:00Added an answer on May 29, 2026 at 10:56 am

    You need to read about jquery a bit which is completely client side. It’s some javascript code executing in the Internet browser.

    Jquery is a greet library to do DOM manipulation (find, modify, add HTML elements) and ajax calls.

    You need to wire the ajax calls to something: either on HTML controls (button, tab, etc.) or to javascript timers.

    Also if you implement ajax calls, that means you have to expose a REST web service on server side (something that responds to an HTTP GET or POST call).

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

Sidebar

Related Questions

I have PDF file data in a SQL Server database, in the column type
I have a base class that contains a SqlDataReader which gets the data using
I have existing client code wherein sql data reader is being used to pull
Under the namespace System.Data.SqlClient , we have both SqlDataReader.GetSqlBinary and SqlDataReader.GetSqlBytes . Both seems
I have a aspx page to do asynchronous calls. The page gets data from
I have a simple button ADD And ADD_Click code is: protected void Add_Click(object sender,
I have some data which I am formatting like this: // ... imagine populating
I have SqlDataReader that was sitting in a page's code behind (well actually a
I have a small C# function that takes any generic SQLDataReader and converts it
I have this piece of code in c#: private static void _constructRow(SqlDataReader reader, system.IO.StreamWriter

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.