Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 46
Data to display differently-SQL Server 4 21
Update in Sql 7 12
Join vs where 2 11
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

743 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

10 Experts available now in Live!

Get 1:1 Help Now