Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2009, 05:43 AM
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
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
Try

fvLoadRates(Me.grdExch)
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Sub fvLoadRates(ByVal obj As Object)

Try

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")

objcnToDB.Disconnect(cn)


Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
__________________
Thank You
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.