This is a migrated thread and some comments may be shown as answers.

Update RadGrid with Update SQL command

1 Answer 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CliffE
Top achievements
Rank 1
CliffE asked on 13 Nov 2012, 12:13 AM
Trying to update RadGrid with the following SQL update command along with this sql select statement.  The table I am updating to has 1 column named "Contactnum" which contains contact #'s and a column "Priority" which lists the Priority as 1,2, or 3.  In my update statement, I need to know how to add the Contactnum2 & Contactnum3 and the Priority 2 and 3 to the update statement.
DECLARE @ContactNum  NVARCHAR(50)
SET @ContactNum = '555-5555 Office'
DECLARE @Priority int
SET @Priority = 1
UPDATE Physician_Contacts
SET ContactNum = @ContactNum
From Physician_Contacts
WHERE Priority = @Priority
SELECT A.Phys_Name, E.Specialty, A.Clinic, A.Office_No, A.Residence_No, A.Fax_no, A.Beeper_note,
                    b.ContactNum, c.ContactNum as Contactnum2,  d.ContactNum as Contactnum3
                    FROM PhysicianMainList as A
                    left join Physician_Contacts as B on A.Phys_Staff_ID = B.Phys_Staff_ID and b.priority = 1
                    left join Physician_Contacts as C on A.Phys_Staff_ID = C.Phys_Staff_ID and c.priority = 2
                    left join Physician_Contacts as D on A.Phys_Staff_ID = D.Phys_Staff_ID and d.priority = 3
                    left join WTH_Specialties as E on E.abbr = A.Specialty                   
                    ORDER BY A.Phys_Name

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 Nov 2012, 01:38 PM
Hello Cliff,

Please check out the following example demonstrating how to manually update RadGrid items binded to a SQL datasource:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/manual-insert-update-delete-operations-using-auto-generated-editform-with-sql-statements-from-the-code-behind.aspx

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
CliffE
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or