My process involves utilizing JavaScript to take a string of 4 hyphen-delimited IDs and a string of 4 hyphen-delimited titles, then making a request for JSON data to my C# web service. Subsequently, the C# web service generates a tracker with a "pending" status and waits for user confirmation before serving up the JSON on the next request.
Once the user confirms the tracker, a dropdown menu displaying the 4 titles allows them to select the most suitable match. Upon confirmation, the selected title is passed to an ActionResult in the web service, which transitions the tracker status to "live" and adds the corresponding ID to the tracker's ID column.
Traditionally, I had the JavaScript send both the 4 IDs and titles as separate strings within the REST request, combining them in the same format in a single column in the row and later splitting them before adding them to the dropdown list.
For instance:
--Data--
ID, TITLE
SDJFJKLS83,Photoshop Digital Photographers Voices Matter
SDJFKS94k4,Adobe Photoshop CS4 Classroom Book
DJFB443B34,Adobe 65014838 Photoshop CS4 Upgrade
SDFHSKBF22,Adobe 65015634 Photoshop CS4
Javascript sends to service as:
ids="SDJFJKLS83-SDJFKS94k4-DJFB443B34-SDFHSKBF22";
titles="Photoshop Digital Photographers Voices Matter- Photoshop CS4 Classroom Book-obe 65014838 Photoshop CS4 Upgrade-Adobe 65015634 Photoshop CS4";
url =
Service Creates new Tracker Row in SQL Table
TrackerID:4
Ids: SDJFJKLS83-SDJFKS94k4-DJFB443B34-SDFHSKBF22
Titles: Photoshop Digital Photographers Voices Matter- Photoshop CS4 Classroom Book-obe 65014838 Photoshop CS4 Upgrade-Adobe 65015634 Photoshop
user: randomperson13
total requests: 1
last request: 2009-03-24 20:12:45.310
status: 0
The service then presents a dropdown list of all the titles for the user to make a selection. The tracker is updated to a "live" status, removing all but one ID from the Id's column, and doing the same with the titles column.
With the single ID and chosen title, the service can retrieve data from another SQL table.
--
In essence, I am seeking suggestions for a more efficient method of storing IDs and associated titles instead of using delimiters in a single datarow.
Thank you for taking the time to read this lengthy post :)
Warm regards.