[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need server side SQL commands for Telerik Listbox Update/Insert/Delete

Posted on 2011-09-09
3
Medium Priority
?
294 Views
Last Modified: 2012-05-12
Hi!

I'm using 2 listboxes to manage add/reorder/delete of records in a linking table.
Table 1 is the feeder table -Table1.ID, Table1.Descrip fills Listbox1
Table 2 is the linking table - Table2.KeyID, Table1ID, Table3ID, Table2SortOrderInt
Table 3 is the other feeder table - Table3.ID, Table3.Descrip

Since it uses a LinkTable, Telerik's basic drag/drop automatic updates don't support it.  The listbox on left works fine, showing Table1 info.  The listbox2 works fine and refreshes with postbacks but nothing is saved to SQL yet.

I need help writing the code behind, vb.net, to commit the changes in Listbox2 please.  Is it something that can be done on Unload each time?

Thanks,
Jo


0
Comment
Question by:BothWorldsJo
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 2000 total points
ID: 36853762
BothWorldsJo,

The challenge as you identified is due to the JOIN involved. At least that is what I understood from question that Listbox 2 is based on a combination of the three tables or at least the second two based on the Table1ID selected in first Listbox. What you can do, is create a VIEW on the SQL side representing that data. Then set up an INSTEAD OF triggers for INSERT, UPDATE, and DELETE on the view. The .NET side will see this as simplified case like Table1 and so should be simple to maintain. From the SQL side, see this reference: http://msdn.microsoft.com/en-us/library/ms179288.aspx

Kevin
0
 

Author Comment

by:BothWorldsJo
ID: 36860800
Didn't know views could do that. Thanks very much!
Jo
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 36872341
You are most welcome!
Best regards and happy coding,

Kevin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question