Solved

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

Posted on 2011-09-09
3
284 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 59

Accepted Solution

by:
Kevin Cross earned 500 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 59

Expert Comment

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

Kevin
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now