![]() |
Click here to advertise with us
|
|
|||||||
| Database General Discussion General discussion on database related topics |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi!
I am a bit a newbie in VB.NET, and I am trying to make some sort of product catalog which will pull data from Access database.The data is displayed in ListView, and I have 2 problems. 1.The following code is for display data text for each selected row from ListView(which is in details): ------------------------------------------------------------------------------------------------------------------------------------------------------------ Private Sub ListView1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick Try Dim str As String Dim j As Byte str = ListView1.Columns(0).Text & " ..." & ListView1.SelectedItems(0).Text For j = 1 To ListView1.Columns.Count - 1 str = str & ListView1.Columns(j).Text & " ... " & ListView1.SelectedItems(0).SubItems(j).Text Next TextBox1.Text = str Catch exp As Exception End Try ----------------------------------------------------------------------------------------------------------------------------------------------------------- I am displayed all data as text from whole row, but I want only to display data from one field in row that is selected. 2.I have in my database a picture for a each row as OLE object, and I want do display that picture in PictureBox for a item that is selected in ListView.I am using a OleDbConnection to populate ListView from database: ------------------------------------------------------------------------------------------------------------------------------- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try oledbcon.Open() strSQL = "SELECT * FROM MaticnePloce" cmd = New OleDbCommand(strSQL, oledbcon) objRead = cmd.ExecuteReader While objRead.Read lv = Me.ListView1.Items.Add(objRead("SifraArtikla") & ("")) lv.SubItems.Add(objRead("NazivArtikla") & "") lv.SubItems.Add(objRead("JM") & "") End While objRead.Close() Catch ex As Exception MessageBox.Show(ex.Message) Finally oledbcon.Close() End Try End Sub ------------------------------------------------------------------------------------------------------------------------------- Any suggestion I will appriciate.Greetz! |
|
||||
|
Quote:
Quote:
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms MSDN: Data Walkthroughs | "How Do I?" Videos My Blog: Custom Events | Dynamic GDI+ Drawing |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|