Wrox Programmer Forums
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 10th, 2009, 05:43 AM
Authorized User
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default edit records in a datagrid

I have a datagrid on a windows form.
I want to set the datasource on load , its a a table in oracle, allow user to view rows and edit them,
Is there any simple code to do this?
Here is come code, this will display my data fine in the grid, but when it comes to editing im lost. I just want the user to be able to edit each row, only certain fields and save:
Private Sub frmRates_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Catch ex As Exception
End Try

End Sub

Sub fvLoadRates(ByVal obj As Object)


Dim objcnToDB As New db (have a separte connection object)
Dim cn As OleDbConnection
cn = objcnToDB.Connect

Dim sSql As String
sSql = "select field1, field2 from tblrates"
da = New OleDbDataAdapter(sSql, cnBTMS)

Dim CmdData As OleDbCommand = New OleDbCommand(sSql, cn)

Dim ds As DataSet = New DataSet
da.Fill(ds, "Exch")
grdExch.SetDataBinding(ds, "Exch")


Catch ex As Exception
End Try
End Sub
Thank You

Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit records problems Indo77 Classic ASP Databases 0 August 11th, 2005 09:35 AM
Edit or Delete records tsimsha Classic ASP Basics 6 October 30th, 2004 03:26 AM
how to know who edit or add records? drachx General .NET 1 October 13th, 2004 05:36 AM
how to know who edit add records? drachx SQL Server 2000 9 October 13th, 2004 04:28 AM
How to add edit records in .dbf file cbpanchal VB Databases Basics 1 July 7th, 2004 11:14 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.