J
James D. Marshall
This is working fine, this is from the page_load subroutine,
'bind System column of SystemInfo table
ddlSystem.DataSource = dsSystemInformation.Tables("SystemInfo")
ddlSystem.DataTextField =
dsSystemInformation.Tables("SystemInfo").Columns("System").ToString
ddlSystem.DataBind()
'populate text boxes with mathing values
PopulateTextBoxes(0)
The PopulateTextboxes works fine
Sub PopulateTextBoxes(ByVal RowID As Integer)
'Assign text property values for the text boxes based on the selectedindex
passed
Dim drw1 As DataRow = dsSystemInformation.Tables("SystemInfo").Rows(RowID)
' What we are doing here is verifying that what is returned from the dataset
is not DBNull,
' if it is true then set the textbox text property to a null string
Dim DBNullCheck As Boolean
Dim PContact As Object = drw1("Primary_Contact")
DBNullCheck = IsDBNull(PContact)
If DBNullCheck = False Then
txtPrimaryContact.Text = PContact
Else
txtPrimaryContact.Text = ""
End If
Dim SContact As Object = drw1("Secondary_Contact")
DBNullCheck = IsDBNull(SContact)
If DBNullCheck = False Then
txtSecondaryContact.Text = SContact
Else
txtSecondaryContact.Text = ""
End If
Dim BHours As Object = drw1("Business_Hours")
DBNullCheck = IsDBNull(BHours)
If DBNullCheck = False Then
txtBusinessHours.Text = BHours
Else
txtBusinessHours.Text = ""
End If
Dim BUnit As Object = drw1("Business_Unit")
DBNullCheck = IsDBNull(BUnit)
If DBNullCheck = False Then
txtBusinessUnit.Text = BUnit
Else
txtBusinessUnit.Text = ""
End If
Dim Dept As Object = drw1("Department")
DBNullCheck = IsDBNull(Dept)
If DBNullCheck = False Then
txtDepartment.Text = Dept
Else
txtDepartment.Text = ""
End If
End Sub
what is not happening is the selectedindex is not being picked up to be
passed to the PopulateTextboxes subroutine, about the only thing I can think
is that I have mixed Windows Form coding with ASP.Net coding
Private Sub ddlSystem_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlSystem.SelectedIndexChanged
'call subroutine to fill in the textboxes with the correct information
PopulateTextBoxes(ddlSystem.SelectedIndex)
End Sub
'bind System column of SystemInfo table
ddlSystem.DataSource = dsSystemInformation.Tables("SystemInfo")
ddlSystem.DataTextField =
dsSystemInformation.Tables("SystemInfo").Columns("System").ToString
ddlSystem.DataBind()
'populate text boxes with mathing values
PopulateTextBoxes(0)
The PopulateTextboxes works fine
Sub PopulateTextBoxes(ByVal RowID As Integer)
'Assign text property values for the text boxes based on the selectedindex
passed
Dim drw1 As DataRow = dsSystemInformation.Tables("SystemInfo").Rows(RowID)
' What we are doing here is verifying that what is returned from the dataset
is not DBNull,
' if it is true then set the textbox text property to a null string
Dim DBNullCheck As Boolean
Dim PContact As Object = drw1("Primary_Contact")
DBNullCheck = IsDBNull(PContact)
If DBNullCheck = False Then
txtPrimaryContact.Text = PContact
Else
txtPrimaryContact.Text = ""
End If
Dim SContact As Object = drw1("Secondary_Contact")
DBNullCheck = IsDBNull(SContact)
If DBNullCheck = False Then
txtSecondaryContact.Text = SContact
Else
txtSecondaryContact.Text = ""
End If
Dim BHours As Object = drw1("Business_Hours")
DBNullCheck = IsDBNull(BHours)
If DBNullCheck = False Then
txtBusinessHours.Text = BHours
Else
txtBusinessHours.Text = ""
End If
Dim BUnit As Object = drw1("Business_Unit")
DBNullCheck = IsDBNull(BUnit)
If DBNullCheck = False Then
txtBusinessUnit.Text = BUnit
Else
txtBusinessUnit.Text = ""
End If
Dim Dept As Object = drw1("Department")
DBNullCheck = IsDBNull(Dept)
If DBNullCheck = False Then
txtDepartment.Text = Dept
Else
txtDepartment.Text = ""
End If
End Sub
what is not happening is the selectedindex is not being picked up to be
passed to the PopulateTextboxes subroutine, about the only thing I can think
is that I have mixed Windows Form coding with ASP.Net coding
Private Sub ddlSystem_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlSystem.SelectedIndexChanged
'call subroutine to fill in the textboxes with the correct information
PopulateTextBoxes(ddlSystem.SelectedIndex)
End Sub