Problems getting the values from a row.
I have a datagrid. When I select a row from the datagrid a dialog
box opens up and is suppose to populate the values.
So this is my modify button event when I select a row?
Public Sub DoModify()
Dim dTable As DataTable = Me.DataGrid1.DataSource
Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext
(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)
Dim dRow As DataRow = CType(bm.Current, DataRowView).Row
Me.lbNumRec.Text = Me.DsTransOverride1.Tables
(0).Rows.Count.ToString()
Dim cEditTransOverride As New EditTransOverride
cEditTransOverride.ShowDialog()
cEditTransOverride.Dispose()
Me.SqlDataAdapter1.Update(Me.DsTransOverride1)
Me.DsTransOverride1.Tables(0).Clear()
Me.SqlDataAdapter1.Fill(Me.DsTransOverride1)
Me.DataGrid1.Refresh()
End Sub
It will bring me to the form EditTransOverride.
Problem is in the Load Event.
Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Save old values
**** oldPolicyNumber = _row.Policy_Number
**** oldTransCode = _row.Original_Transaction_Code
*** oldTransEffDate = _row._Trans__Eff__Date
End Sub
I have the following
Private _rowNumber As Integer
Dim _row As DSTransOverride.dbo_stp_SelTransOverridesRow
Dim oldPolicyNumber As String
Dim oldTransCode As String
Dim oldTransEffDate As String
Public Property rowNo() As Integer
Get
Return _rowNumber
End Get
Set(ByVal Value As Integer)
_rowNumber = Value
End Set
End Property
Public Property row() As
DSTransOverride.dbo_stp_SelTransOverridesRow
Get
Return _row
End Get
Set(ByVal Value As
DSTransOverride.dbo_stp_SelTransOverridesRow)
_row = Value
End Set
End Property
The problem I get is the following:
An unhandled exception of type 'System.NullReferenceException'
occurred in CCFinSol.exe
Additional information: Object reference not set to an instance
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/