| | |
Accessing data in a datagrid...
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
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 30minutes 2008 access add application arithmetic array assignment basic beginner box button buttons click code combo component connectionstring convert cpu cuesent data database databasesearch datagrid datagridview datetimepicker design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net exists firewall folder forms html image images isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open peertopeervideostreaming picturebox1 picturebox2 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left savedialog serial settings socket sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio visualstudio.net web wpf wrapingcode xml






