| | |
Accessing data in a datagrid...
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 2
Reputation:
Solved Threads: 0
I have a basic program that access a local Access database, reads data from it into a datagrid, and then allows me to manipulate it by using textboxes. I can add, delete, and search for records. I want to remove the textboxes from the equation completely. Is there any way I can access the data in the datagrid through code so I can use it in SQL statements?
i.e. DataGrid.SelectedRow.Column(3).Value
i.e. DataGrid.SelectedRow.Column(3).Value
initial condition
i.e : (this following code will select user where id user = value of first column from selected datagrid). Of course in datagrid click event :
vb Syntax (Toggle Plain Text)
Dim i As Integer i = dgUser.CurrentRowIndex()
i.e : (this following code will select user where id user = value of first column from selected datagrid). Of course in datagrid click event :
vb Syntax (Toggle Plain Text)
Private Sub dgPendidikan_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgPendidikan.Click ... cmdUser.CommandText = "SELECT * FROM Users where IdUser ='" & Trim(dgUser.Item(i, 0)) & "'" .... end sub
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
you're Welcome
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- How can i retrieve data after i logod on..... (ASP.NET)
- ASP.NET Tutorial: Caching in ASP.NET (ASP.NET)
- Adding a checkbox column dynamically (C#)
Other Threads in the VB.NET Forum
- Previous Thread: how to import data from SQL database to excell?
- Next Thread: System Usage Administration - Internet cafe management
| Thread Tools | Search this Thread |
"crystal .net .net2005 .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net employees excel exists firewall forms html image images isnumericfuntioncall listview login map math memory mobile module mssqlbackend mysql navigate net number opacity open pdf picturebox2 port print printpreview record regex reports" reuse right-to-left save savedialog search serial settings socket sqldatbase sqlserver storedprocedure string temp textbox timer timespan transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic.net visualstudio.net web wpf wrapingcode xml






