VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Updating SQL Join via DATASET Posted by matthew5 on 18 Nov 2008 at 8:41 PM
I need some help, I have been at this for a few days...
I have a datagridview that I am populating with an SQL JOIN with the following stored procedure...

CREATE PROCEDURE sp_company_GRIDVIEW_Iuserid_companyid
@companytypenumber int,
@iuserid int
AS
Select tblcompany.CompanyName as [Company Name],
tblcompanytypes.Companytype as [Group Name],
tblcompany.phoneNumber as [Phone Number],
tblcompany.Altphone as [Alternate Phone],
tblcompany.Address,
tblcompany.city,
tblcompany.EmailAddress as [Email Address]
From tblcompany INNER JOin tblcompanytypes ON
tblcompany.companytypeNumber = tblcompanytypes.companytypenumber
Where tblcompanytypes.IUSERID = @iuserid And tblcompanytypes.companytypenumber = @companytypenumber
GO

The results are successfully returned into the datagridview, and it works great,
However I would like to implement the functionality to update, insert, and delete from the datagrid.

To start with the following code, saves changes to my dataset, with the cellendedit event of the datagrid with following..

Private Sub dgcompanies_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgcompanies.CellEndEdit
If Me.PersDB01DataSet.HasChanges Then
Me.PersDB01DataSet.AcceptChanges()

End If
End Sub

There is a save button, that I want to update persdb01dataset to the datasource.
What is the best way to do this? I am really stuck and in need of some help.
Any help is much appreciated, thank you very much.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.