RE: Trouble displaying info from access db
- From: Jason Fortner <jasonf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(donotspam)>
- Date: Wed, 22 Nov 2006 07:16:02 -0800
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
_____________________________________________________
- References:
- Trouble displaying info from access db
- From: GeekyChicky79
- Trouble displaying info from access db
- Prev by Date: Re: Data Provider for Oracle: MS version vs. Oracle?
- Next by Date: reuse connection object with diff username password?
- Previous by thread: Trouble displaying info from access db
- Next by thread: Best way to reference a value in DataRowView
- Index(es):
Relevant Pages
|