RE: Trouble displaying info from access db



Is lblSubName the name or your label?

You are trying to get the code in the lable to change when you change the
selection in the combo box correct? Also have you hooked a debugger to the
code and checked that the code values are being placed in the dataset?
--
Jason Fortner

MCAD .NET, MCSD .NET, Sharepoint Development
Total Productivity Solutions, Inc.
http://totalproductivitysolutions.com


"GeekyChicky79" wrote:

Hi Everyone,

I have the project below where I'm pulling out information from 1 table

"Subjects", pulling the Subjects, and SubjectCode. The Subjects are
displaying in the Combo Box just fine, but I can not get the
corresponding Subject Code to display in the Label.


I have 2 Data adapters/dataset,1 for Subjects, and the other for
SubjectCode, along with a Data View setup.


I'm a newbie on VB.NET. This project is pulling from an Access DB. Is
there anything that I should be looking for, or doing wrong that I'm
not getting the Subject Code to display in the Label?


Any help would be appreciated.


__________________________________
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Fill the List box
dbSubject.Fill(DsSubject1)
dbSubjectCode.Fill(DsSubjectCode2)
DisplayRecordPosition()
End Sub


Private Sub cboSubjectName_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cboSubjectName.SelectedIndexChanged
' DsSubject1.Clear()
' dbSubject.SelectCommand.Parameters("Subjects").Value =
cboSubjectName.Text
' dbSubjectCode.Fill(DsSubjectCode2)
End Sub


Private Sub lblSubName_Click(ByVal sender As System.Object, ByVal e

As System.EventArgs) Handles lblSubName.Click
DsSubjectCode2.Clear()
dbSubjectCode.SelectCommand.Parameters("SubjectCode").Value =
lblSubName.Text
dbSubjectCode.Fill(DsSubjectCode2)


End Sub
'*****General Procedures*****
Private Sub DisplayRecordPosition()
Dim intRecordCount As Integer
Dim intRecordPosition As Integer


intRecordCount = DsSubject1.Tables("Subjects").Rows.Count


If intRecordCount = 0 Then
lblSubName.Text = "(No records)"
Else
intRecordPosition = Me.BindingContext(DsSubject1,
"Subjects").Position + 1
lblSubName.Text = "Record: " & intRecordPosition.ToString _

& " of " & intRecordCount.ToString
End If
End Sub
End Class
_____________________________________________________


.



Relevant Pages

  • Re: Trouble displaying info from access db
    ... set Label Value ... not getting the Subject Code to display in the Label? ... Private Sub Form1_Load(ByVal sender As System.Object, ... Dim intRecordCount As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • class problem, How to get data from class
    ... and can be displayed in label or textbox but ... public function test ... private sub timer1_tick ... labels that display this data, how do i extract it from the class. ...
    (microsoft.public.dotnet.languages.vb)
  • Trouble displaying info from access db
    ... "Subjects", pulling the Subjects, and SubjectCode. ... not getting the Subject Code to display in the Label? ... Private Sub Form1_Load(ByVal sender As System.Object, ... Dim intRecordCount As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Unable to capture absolute paths with Drag and Drop
    ... label in the form does display the absolute paths of these files. ... Private Sub Panel1_DragDrop(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.general)
  • Trouble displaying info from access db
    ... "Subjects", pulling the Subjects, and SubjectCode. ... not getting the Subject Code to display in the Label? ... Private Sub Form1_Load(ByVal sender As System.Object, ... Dim intRecordCount As Integer ...
    (microsoft.public.dotnet.framework.adonet)