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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:17:24+00:00 2026-05-21T22:17:24+00:00

Hi everyone and thanks for looking. I have a webform that hooks into a

  • 0

Hi everyone and thanks for looking.

I have a webform that hooks into a SQL Server 2005 database. Aside from submitting flat data, I’m using two select statements. The first populates a drop down list with the names of other users from the database.

SELECT Firstname + ' ' + LastName
FROM KB_XMod_Modules 
WHERE FormID=3

This is fine but I also need to update other users records to show when they’ve been selected by the current profile. Think of it as ‘John likes Paul’ and on Paul’s record it should show ‘Paul is liked by John’.

I’ve been struggling and the closest I’ve got is having this second statement on the form…

SELECT Firstname + ' ' + LastName
FROM KB_XMod_Modules 
WHERE LikedByID = 'Current Record ID'

This kind of works but the problem is that it won’t display on ‘Paul’s’ record that he’s ‘Liked by John’ until I’ve opened up and saved Paul’s record. I’m going to be working with several hundred records so this can’t be done manually. I need a way of being able to directly update Paul when I save John.

Ideally I think I’d like to bolt on an UPDATE to the first statement that populates the drop down list with users names but also updates the related record on submission but don’t think this is possible.

I’m just getting into SQL and finding it difficult to work out the best way to do this…

Thanks again.

  • 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-21T22:17:25+00:00Added an answer on May 21, 2026 at 10:17 pm

    Consider having an ID in your dropdownlist like:

      SELECT Firstname + ' ' + LastName AS FullName, ID
      FROM KB_XMod_Modules WHERE FormID=3
    

    Your dropdown can then remember which person you’re on:

     <asp:DropDownList DataTextField="FullName" DataValueField="ID" ..... />
    

    Let’s pretend that Paul likes John. When you’re saving a ‘like’, you can :

     UPDATE KB_XMod_Modules 
     SET LikedByID = IdFromYourDropDownSelectedValueForPaul
     WHERE ID = JohnID
    

    Also consider whether a person could be liked by more than one other person. In that case you’d need to refactor your database design:

    CREATE TABLES PersonLikes(
     PersonID  int,
     LikedBy   int)
    

    You’d then need to only:

    INSERT INTO PersonLikes(PersonID,LikedBy) VALUES(@PaulID, @JohnID)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thanks everyone for taking the time to read this. I have styled my navigation
Thanks to everyone out there helping newbies like me. So far I have this:
I have the following script which thanks to the help of everyone is almost
I have written two methods that take and return a string. One converts from
I have some old school looking code that is as follows: IList<KeyValuePair<string, ValuePair>> ServicePairs
Thanks to everyone in advance! I have attached a nsIWebProgressListener to a xul:browser and
UPDATE: Thanks to everyone for the responses. I didn't realize document.write() was deprecated. Add
Hello and thanks to everyone for reading my question. I've been working on a
This is my first question. Thanks to everyone who contributes to this site, it's
I am wondering what everyone thinks the best method of handling results from your

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.