Question:
Showing database data in textboxes Visual Basic 2010?
Brad
2012-07-18 01:52:42 UTC
I have used a datagridview to let the user search through the database. Now I want the user to be able to click on an item in the search and the program to open a new form where all the information would be shown in various objects.

For my project I'm using movies, so I would have picture box as well for the poster of the film. The hard part is getting the selection from the data grid to transfer. This is confusing me.

Any ideas on how to do this? provide code if possible

thanks
Four answers:
Gardner
2012-07-18 02:07:45 UTC
I have a datagridview that lists out all orders for a particular customer. You can double click on a line and pull up the details of the order. In this example, the order id is stored in a cell titled OID#



Private Sub dgOrderDataGridView_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dgOrdererDataGridView.DoubleClick

'

' Get all available Data for selected order on the grid

Try

If dgOrderDataGridView.CurrentRow.Cells ("OID#").Value Is Nothing Then

'

' If the Order ID # is null then cancel and clear the selected row

dgOrderDataGridView.ClearSelection()

Exit Sub

End If

'

' Request order data

Try

Dim orderer_lookup As Integer

order_lookup = CInt(dgOrderDataGridView.CurrentRow.Cells ("OID#").Value)

'

' Your lookup code goes here. Use order_lookup to link to the database

'

Catch ex As Exception

Finally

End Try

Catch ex As NullReferenceException

'

' NullReferenceException. User dbl clicked an empty datagrid

MsgBox("There are no orders to select", MsgBoxStyle.OkOnly, "No Order Data")

End Try

End Sub



Edited to fix where Yahoo butchered the code.
?
2017-01-20 19:20:57 UTC
1
?
2016-05-18 14:07:55 UTC
Why do you use a picture box and not a label? I believe with Label is very simple You can make a label on the same position, size, background and foreground color of the textbox password Start with show label and hide textbox. When user click on label, in the label click event you hide label and show textbox Sub label_click ... Label1.visible=false Textbox1.visible=true End sub Use textbox password char to set character to show when you digit password When user press return you hide textbox, copy password with label1.text = textbox1.text and show label
anonymous
2015-01-26 05:28:05 UTC
reverse phone number search compiles hundreds of millions of phone book records to help locate the owner's name, location, time zone, email and other public information.



Use a reverse phone lookup to:

Get the identity of an unknown caller.

Identify an area code.

Recall the name of a person whose number you wrote down.

Identify an unfamiliar phone number that shows up on your bill.

https://tr.im/721a7


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...