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 6667967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:59:21+00:00 2026-05-26T02:59:21+00:00

I have 2 working sections of code and need to put them together section

  • 0

I have 2 working sections of code and need to put them together

section 1 –

the user can visit a page, view & edit the contents of a database, which includes news articles, titles, related links etc, i’ve managed to get this working & the data is saved to the db

section 2 –

a javascript news scroller on the homepage of the site writes out a series of divs which are then rotated using javascript & CSS to make it look like they are scrolling, again this works fine. The news articles are drawn in from an array hard coded on the homepage

Problem – i want the user to be able to edit the news feed by editing the content of the DB, sort of like a homemade CMS system but only for 1 page.

How do i take a variable from the DB (i’m guessing using a SQLDataSource) and assign it to a variable which i can then write out to the javascript array & therefore into the news feed on the homepage.

I apologise if this is a simple question but i’m struggling with it, my C# & .net skills are quite limited any help would be very gratefully recieved

Thanks
Ben

  • 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-26T02:59:22+00:00Added an answer on May 26, 2026 at 2:59 am

    The simple scenario

    When a user visits a page where they can edit news items and updates/adds new news items, the application should persist those changes to the database.

    When a user visits the page with the news scroller after a user has edited/added new news items, they will see the updated items as the application will get the news items from the database when the page is requested.

    A more complex scenario

    When a user visits a page where they can edit news items and updates/adds new news items, the application should persist those changes to the database.

    The page with the news scroller polls the server using AJAX to get news items. Any new news items that it retrieves (perhaps by passing in the request an id or datetime of the most recent news item) will then be displayed. The newer news items may replace older news items that are held in a JavaScript array of news items on the client.

    How the data is retrieved from the database could be done in numerous ways:

    1. You could use a SqlDataSource control, but I’d only really recommend doing this if this is a small application because the control starts to mix data access logic into the presentation layer.

    2. You could use vanilla ADO.NET with a SqlConnection, SqlCommand and SqlDataReader to read the records out of the database.

    3. You could use LINQ to SQL to read the record out. This may save some time over number 2.

    4. You could use any number of other data access tools such as Dapper.NET, Massive, Simple.Data, Entity Framework, NHibernate, etc. Your mileage may vary on what is the most appropriate tool for the complexity/simplcity of the application.

    Let me know if this answers your question and if not, I’ll see if I can elaborate.

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

Sidebar

Related Questions

I have several sections of code that I need to protect with a Mutex.
I have been working on some legacy C++ code that uses variable length structures
I have this code to restart a service, but this is not working. I
I have a section of code that depending on the URL requested, will include
I have a section in my code looking like this: $accounts[] = array(id =>
I have a XAMl string table that is working a treat when i need
I'm working on a internal web application (only employees can log in) and need
I have been working on a web services related project for about the last
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working with a string[] array in C# that gets returned from

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.