By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Weird Error

P: n/a
This exception occured while running in the development environment. The
debugger didnt catch it though it appeared as a message box
prompt........does anyone have insight on this?
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Windows.Forms.DataGrid.AddNewRow()
at System.Windows.Forms.DataGridAddNewRow.OnEdit()
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Looks like you are trying to pass add a row to your datatable but the row
must not reference a row object. You probably forgot to use 'New'.
System.Windows.Forms.DataGrid.AddNewRow()
Regards - OHM#

scorpion53061 wrote:
This exception occured while running in the development environment.
The debugger didnt catch it though it appeared as a message box
prompt........does anyone have insight on this?
************** Exception Text **************
System.NullReferenceException: Object reference not set to an
instance of an object.
at System.Windows.Forms.DataGrid.AddNewRow()
at System.Windows.Forms.DataGridAddNewRow.OnEdit()
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #2

P: n/a
That is the thing though......

I set hte grid to be read only in the designer. You can't add a row.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in message
news:uf**************@tk2msftngp13.phx.gbl...
Looks like you are trying to pass add a row to your datatable but the row
must not reference a row object. You probably forgot to use 'New'.
System.Windows.Forms.DataGrid.AddNewRow()
Regards - OHM#

scorpion53061 wrote:
This exception occured while running in the development environment.
The debugger didnt catch it though it appeared as a message box
prompt........does anyone have insight on this?
************** Exception Text **************
System.NullReferenceException: Object reference not set to an
instance of an object.
at System.Windows.Forms.DataGrid.AddNewRow()
at System.Windows.Forms.DataGridAddNewRow.OnEdit()
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()


Regards - OHM# On**********@BTInternet.com

Nov 20 '05 #3

P: n/a
Either send the code zipped and I'll try it or paste the relevant code here.
You ARE running code which is causing this error, it's possibly in the
Form_Load event

OHM#

scorpion53061 wrote:
That is the thing though......

I set hte grid to be read only in the designer. You can't add a row.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:uf**************@tk2msftngp13.phx.gbl...
Looks like you are trying to pass add a row to your datatable but
the row must not reference a row object. You probably forgot to use
'New'.
System.Windows.Forms.DataGrid.AddNewRow()
Regards - OHM#

scorpion53061 wrote:
This exception occured while running in the development environment.
The debugger didnt catch it though it appeared as a message box
prompt........does anyone have insight on this?
************** Exception Text **************
System.NullReferenceException: Object reference not set to an
instance of an object.
at System.Windows.Forms.DataGrid.AddNewRow()
at System.Windows.Forms.DataGridAddNewRow.OnEdit()
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()


Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #4

P: n/a
I just emailed you.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
Either send the code zipped and I'll try it or paste the relevant code here. You ARE running code which is causing this error, it's possibly in the
Form_Load event

OHM#

scorpion53061 wrote:
That is the thing though......

I set hte grid to be read only in the designer. You can't add a row.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:uf**************@tk2msftngp13.phx.gbl...
Looks like you are trying to pass add a row to your datatable but
the row must not reference a row object. You probably forgot to use
'New'.
System.Windows.Forms.DataGrid.AddNewRow()
Regards - OHM#

scorpion53061 wrote:
This exception occured while running in the development environment.
The debugger didnt catch it though it appeared as a message box
prompt........does anyone have insight on this?
************** Exception Text **************
System.NullReferenceException: Object reference not set to an
instance of an object.
at System.Windows.Forms.DataGrid.AddNewRow()
at System.Windows.Forms.DataGridAddNewRow.OnEdit()
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()

Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com

Nov 20 '05 #5

P: n/a
2 datagrids with 2 click events and 2 resizing and column styles.

THe error occurs after clicking in the grid and then going to click a
button, it does not matter which one.

Thanks again.........

Private Sub ItemList_CurrentCellChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles

DataGrid1.CurrentCellChanged
Dim itemcheck As Integer
Dim foundit As Boolean
Dim chitem1 As String
chitem1 = DataGrid1.Item(DataGrid1.CurrentCell)
For itemcheck = 0 To dscopy.Tables(0).Rows.Count - 1
If chitem1 =
dscopy.Tables(0).Rows(itemcheck).Item(newcol.Colum nName) Then
chitem = DataGrid1.Item(DataGrid1.CurrentCell)
Label2.Text = ""
Label18.Text = ""
Label14.Text = ""
Label7.Text = ""
Label16.Text = ""
Label11.Text = ""
TextBox1.Text = ""
Label6.Text = ""
desctext =
dscopy.Tables(0).Rows(itemcheck).Item(newcol1.Colu mnName)
foundit = True
Label3.Text = chitem
EnableFunctions()
'Button1.Focus()
DataGrid1.Refresh()
foundit = True
AssignValues()
Exit For
Exit Sub
End If
Next
If foundit = False Then
Exit Sub
End If

End Sub
'datagrid for reports
Private Sub ItemList2_CurrentCellChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles

DataGrid2.CurrentCellChanged
Dim itemcheck As Integer
Dim foundit As Boolean
Dim chitem1 As String
chitem1 = DataGrid2.Item(DataGrid2.CurrentCell)
For itemcheck = 0 To dscopy.Tables(0).Rows.Count - 1
If chitem1 =
dscopy.Tables(0).Rows(itemcheck).Item(newcol.Colum nName) Then
chitem = DataGrid2.Item(DataGrid2.CurrentCell)
Label2.Text = ""
Label18.Text = ""
Label14.Text = ""
Label7.Text = ""
Label16.Text = ""
Label11.Text = ""
TextBox1.Text = ""
Label6.Text = ""
desctext =
dscopy.Tables(0).Rows(itemcheck).Item(newcol1.Colu mnName)
foundit = True
Label3.Text = chitem.ToString
EnableFunctions()
'Button1.Focus()
DataGrid2.Refresh()
foundit = True
AssignValues()
Exit For
Exit Sub
End If
Next
If foundit = False Then
Exit Sub
End If

End Sub

Public Sub AddSizedColoredColumns2()
DataGrid1.TableStyles.Clear()
'DataGrid2.TableStyles.Clear()

Dim Artwork1 As New DataGridTableStyle
Artwork1.MappingName = dscopy.Tables(0).TableName '"FAVORITEITEMS"
If TabControl1.SelectedIndex = 2 Then
Dim BOOKSLABEL As New DatagridFormat
BOOKSLABEL.TextBox.BackColor = Color.SpringGreen
BOOKSLABEL.MappingName = "ITEMNO"
BOOKSLABEL.HeaderText = "ITEM"
'BOOKSLABEL.Width = 200
BOOKSLABEL.TextBox.ReadOnly = True
BOOKSLABEL.NullText = "VALUE"

Dim ANSWERGRID As New DatagridFormat
ANSWERGRID.MappingName = "DESCRIPTION"
ANSWERGRID.HeaderText = "DESC"
'ANSWERGRID.Width = 300
ANSWERGRID.NullText = "VALUE"
ANSWERGRID.Alignment = HorizontalAlignment.Left

Dim ANSWERGRID1 As New DatagridFormat
ANSWERGRID1.MappingName = "UM"
ANSWERGRID1.HeaderText = "UM"
'ANSWERGRID1.Width = 50
ANSWERGRID1.Alignment = HorizontalAlignment.Left
ANSWERGRID1.NullText = "NONE RECORDED"
ANSWERGRID1.TextBox.ReadOnly = True

Dim ANSWERGRID2 As New DatagridFormat
ANSWERGRID2.MappingName = "TYPE"
ANSWERGRID2.HeaderText = "TYPE"
'ANSWERGRID2.Width = 200
'ANSWERGRID2.Width = 200
ANSWERGRID2.Alignment = HorizontalAlignment.Left
ANSWERGRID2.NullText = "VALUE"
ANSWERGRID2.TextBox.ReadOnly = True

Artwork1.GridColumnStyles.Add(ANSWERGRID)
Artwork1.GridColumnStyles.Add(BOOKSLABEL)
Artwork1.GridColumnStyles.Add(ANSWERGRID1)
Artwork1.GridColumnStyles.Add(ANSWERGRID2)
Artwork1.PreferredRowHeight = 40
Artwork1.GridColumnStyles.Item(0).NullText = ""
Artwork1.GridLineColor =
System.Drawing.SystemColors.ControlDarkDark
Artwork1.GridLineStyle = DataGridLineStyle.Solid
Artwork1.HeaderBackColor = System.Drawing.Color.DarkBlue
Artwork1.HeaderForeColor =
System.Drawing.SystemColors.ActiveCaptionText
Artwork1.RowHeadersVisible = False
Artwork1.AllowSorting = False
Artwork1.BackColor =
System.Drawing.SystemColors.ActiveCaptionText
'AutoSizeTable()
Dim numCols As Integer
numCols = dscopy.Tables(0).Columns.Count
Dim i As Integer
i = 0
Do While (i < numCols)
AutoSizeCol(i)
i = (i + 1)
Loop
DataGrid1.TableStyles.Add(Artwork1)
DataGrid1.ReadOnly = True
MsgBox(numCols & " is numcols" & vbCrLf &
dscopy.Tables(0).Columns.Count)
Exit Sub
End If

'additional pages setup
End Sub

Public Sub AddSizedColoredColumns3()
DataGrid2.TableStyles.Clear()
If typeofreport = "OPEN" Then
'DataGrid2.TableStyles.Clear()

Dim OpenStyle As New DataGridTableStyle
OpenStyle.MappingName = dsreportscopy.Tables(0).TableName
'"FAVORITEITEMS"
Dim OpenItemNo As New DatagridFormat
OpenItemNo.TextBox.BackColor = Color.SpringGreen
OpenItemNo.MappingName = "ITEMNO"
OpenItemNo.HeaderText = "ITEM"
'OpenItemNo.Width = 200
OpenItemNo.TextBox.ReadOnly = True
OpenItemNo.NullText = "VALUE"

Dim OpenDateOr As New DatagridFormat
OpenDateOr.MappingName = "dateor"
OpenDateOr.HeaderText = "DATE"
'OpenDateOr.Width = 300
OpenDateOr.NullText = "VALUE"
OpenDateOr.Alignment = HorizontalAlignment.Left

Dim OpenCustpo As New DatagridFormat
OpenCustpo.MappingName = "custpo"
OpenCustpo.HeaderText = "PO/JOB#"
'OpenCustpo.Width = 50
OpenCustpo.Alignment = HorizontalAlignment.Left
OpenCustpo.NullText = "NONE RECORDED"
OpenCustpo.TextBox.ReadOnly = True

Dim OpenORDERNO As New DatagridFormat
OpenORDERNO.MappingName = "ORDERNO"
OpenORDERNO.HeaderText = "JJK#"
'OpenORDERNO.Width = 200
'OpenORDERNO.Width = 200
OpenORDERNO.Alignment = HorizontalAlignment.Left
OpenORDERNO.NullText = "VALUE"
OpenORDERNO.TextBox.ReadOnly = True

Dim OPENLN As New DatagridFormat
OPENLN.MappingName = "LN"
OPENLN.HeaderText = "LINE"
'OPENLN.Width = 200
'OPENLN.Width = 200
OPENLN.Alignment = HorizontalAlignment.Left
OPENLN.NullText = "VALUE"
OPENLN.TextBox.ReadOnly = True

Dim OPENPRICE As New DatagridFormat
OPENPRICE.MappingName = "PRICE"
OPENPRICE.HeaderText = "COST"
'OPENPRICE.Width = 200
'OPENPRICE.Width = 200
OPENPRICE.Alignment = HorizontalAlignment.Left
OPENPRICE.NullText = "VALUE"
OPENPRICE.TextBox.ReadOnly = True

Dim OPENUM As New DatagridFormat
OPENUM.MappingName = "UM"
OPENUM.HeaderText = "UM"
'OPENUM.Width = 200
'OPENUM.Width = 200
OPENUM.Alignment = HorizontalAlignment.Left
OPENUM.NullText = "VALUE"
OPENUM.TextBox.ReadOnly = True
Dim OPENtotprice As New DatagridFormat
OPENtotprice.MappingName = "totprice"
OPENtotprice.HeaderText = "TOTAL"
'OPENtotprice.Width = 200
'OPENtotprice.Width = 200
OPENtotprice.Alignment = HorizontalAlignment.Left
OPENtotprice.NullText = "VALUE"
OPENtotprice.TextBox.ReadOnly = True

Dim OPENQTYALL As New DatagridFormat
OPENQTYALL.MappingName = "QTYALL"
OPENQTYALL.HeaderText = "ALLOC"
'OPENQTYALL.Width = 200
'OPENQTYALL.Width = 200
OPENQTYALL.Alignment = HorizontalAlignment.Left
OPENQTYALL.NullText = "VALUE"
OPENQTYALL.TextBox.ReadOnly = True

Dim OPENQTYBACK As New DatagridFormat
OPENQTYBACK.MappingName = "QTYBACK"
OPENQTYBACK.HeaderText = "BACK"
'OPENQTYBACK.Width = 200
'OPENQTYBACK.Width = 200
OPENQTYBACK.Alignment = HorizontalAlignment.Left
OPENQTYBACK.NullText = "VALUE"
OPENQTYBACK.TextBox.ReadOnly = True

Dim OPENQTY As New DatagridFormat
OPENQTY.MappingName = "QTY"
OPENQTY.HeaderText = "QTY"
'OPENQTY.Width = 200
'OPENQTY.Width = 200
OPENQTY.Alignment = HorizontalAlignment.Left
OPENQTY.NullText = "VALUE"
OPENQTY.TextBox.ReadOnly = True

OpenStyle.GridColumnStyles.Add(OpenDateOr)
OpenStyle.GridColumnStyles.Add(OpenItemNo)
OpenStyle.GridColumnStyles.Add(OpenCustpo)
OpenStyle.GridColumnStyles.Add(OpenORDERNO)
OpenStyle.GridColumnStyles.Add(OPENLN)
OpenStyle.GridColumnStyles.Add(OPENPRICE)
OpenStyle.GridColumnStyles.Add(OPENUM)
OpenStyle.GridColumnStyles.Add(OPENQTY)
OpenStyle.GridColumnStyles.Add(OPENtotprice)
OpenStyle.GridColumnStyles.Add(OPENQTYALL)
OpenStyle.GridColumnStyles.Add(OPENQTYBACK)

OpenStyle.PreferredRowHeight = 40
OpenStyle.GridColumnStyles.Item(0).NullText = ""
OpenStyle.GridLineColor =
System.Drawing.SystemColors.ControlDarkDark
OpenStyle.GridLineStyle = DataGridLineStyle.Solid
OpenStyle.HeaderBackColor = System.Drawing.Color.DarkBlue
OpenStyle.HeaderForeColor =
System.Drawing.SystemColors.ActiveCaptionText
OpenStyle.RowHeadersVisible = False
OpenStyle.AllowSorting = False
OpenStyle.BackColor =
System.Drawing.SystemColors.ActiveCaptionText
'AutoSizeTable()
Dim numCols As Integer
numCols = dsreportscopy.Tables(0).Columns.Count
Dim i As Integer
i = 0
Do While (i < numCols)
AutoSizeCol2(i)
i = (i + 1)
Loop
DataGrid2.TableStyles.Add(OpenStyle)
DataGrid2.ReadOnly = True
Exit Sub
End If
'additional pages setup

End Sub

Public Sub AutoSizeTable()

Dim numCols As Integer
numCols = dscopy.Tables(0).Columns.Count
'numCols = CType(DataGrid1.DataSource, DataTable).Columns.Count
Dim i As Integer
i = 0

Do While (i < numCols)
AutoSizeCol(i)
i = (i + 1)

Loop

End Sub

Public Sub AutoSizeCols(ByVal start As Integer, ByVal finish As Integer)

Dim i As Integer
i = start

Do While (i <= finish)
AutoSizeCol(i)
i = (i + 1)

Loop

End Sub

Public Sub AutoSizeCol(ByVal col As Integer)

Dim width As Single
width = 0
Dim numRows As Integer
numRows = dscopy.Tables(0).Rows.Count
'numRows = CType(DataGrid1.DataSource, DataTable).Rows.Count
Dim g As Graphics
g = Graphics.FromHwnd(DataGrid1.Handle)
Dim sf As StringFormat
sf = New StringFormat(StringFormat.GenericTypographic)
Dim size As SizeF
Dim i As Integer
i = 0

Do While (i < numRows)
size = g.MeasureString(DataGrid1(i, col).ToString,
DataGrid1.Font, 500, sf)
If (size.Width > width) Then
width = size.Width
End If
i = (i + 1)

Loop
'DataGrid1.Width = (size.Width * dscopy.Tables(0).Columns.Count + 1)
* dscopy.Tables(0).Columns.Count + 1
g.Dispose()
'
DataGrid1.TableStyles(dscopy.Tables(0).TableName). GridColumnStyles(col).Widt
h = CType(width, Integer)

End Sub

Public Sub AutoSizeTable2()

Dim numCols As Integer
numCols = dsreportscopy.Tables(0).Columns.Count
'numCols = CType(DataGrid1.DataSource, DataTable).Columns.Count
Dim i As Integer
i = 0

Do While (i < numCols)
AutoSizeCol2(i)
i = (i + 1)

Loop

End Sub

Public Sub AutoSizeCols2(ByVal start As Integer, ByVal finish As
Integer)

Dim i As Integer
i = start

Do While (i <= finish)
AutoSizeCol2(i)
i = (i + 1)

Loop

End Sub

Public Sub AutoSizeCol2(ByVal col As Integer)

Dim width As Single
width = 0
Dim numRows As Integer
numRows = dsreportscopy.Tables(0).Rows.Count
'numRows = CType(datagrid2.DataSource, DataTable).Rows.Count
Dim g As Graphics
g = Graphics.FromHwnd(DataGrid2.Handle)
Dim sf As StringFormat
sf = New StringFormat(StringFormat.GenericTypographic)
Dim size As SizeF
Dim i As Integer
i = 0

Do While (i < numRows)
size = g.MeasureString(DataGrid2(i, col).ToString,
DataGrid2.Font, 500, sf)
If (size.Width > width) Then
width = size.Width
End If
i = (i + 1)

Loop
'datagrid2.Width = (size.Width *
dsreportscopy.Tables(0).Columns.Count + 1) *
dsreportscopy.Tables(0).Columns.Count

+ 1
g.Dispose()
'
datagrid2.TableStyles(dsreportscopy.Tables(0).Tabl eName).GridColumnStyles(co
l).Width = CType(width, Integer)

End Sub
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
I just emailed you.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
Either send the code zipped and I'll try it or paste the relevant code

here.
You ARE running code which is causing this error, it's possibly in the
Form_Load event

OHM#

scorpion53061 wrote:
That is the thing though......

I set hte grid to be read only in the designer. You can't add a row.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:uf**************@tk2msftngp13.phx.gbl...
> Looks like you are trying to pass add a row to your datatable but
> the row must not reference a row object. You probably forgot to use
> 'New'.
>
>
> System.Windows.Forms.DataGrid.AddNewRow()
>
>
> Regards - OHM#
>
>
>
> scorpion53061 wrote:
>> This exception occured while running in the development environment.
>> The debugger didnt catch it though it appeared as a message box
>> prompt........does anyone have insight on this?
>>
>>
>> ************** Exception Text **************
>> System.NullReferenceException: Object reference not set to an
>> instance of an object.
>> at System.Windows.Forms.DataGrid.AddNewRow()
>> at System.Windows.Forms.DataGridAddNewRow.OnEdit()
>> at System.Windows.Forms.DataGrid.Edit(String instantText)
>> at System.Windows.Forms.DataGrid.Edit()
>> at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
>> at System.Windows.Forms.Control.NotifyEnter()
>> at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()
>
> Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com


Nov 20 '05 #6

P: n/a
Thanks but the code is incomplete and thefore I cannot run it. Please send
entire form.

Regards - OHM#
scorpion53061 wrote:
I just emailed you.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:e4**************@TK2MSFTNGP12.phx.gbl...
Either send the code zipped and I'll try it or paste the relevant
code here. You ARE running code which is causing this error, it's
possibly in the Form_Load event

OHM#

scorpion53061 wrote:
That is the thing though......

I set hte grid to be read only in the designer. You can't add a row.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:uf**************@tk2msftngp13.phx.gbl...
Looks like you are trying to pass add a row to your datatable but
the row must not reference a row object. You probably forgot to use
'New'.
System.Windows.Forms.DataGrid.AddNewRow()
Regards - OHM#

scorpion53061 wrote:
> This exception occured while running in the development
> environment. The debugger didnt catch it though it appeared as a
> message box prompt........does anyone have insight on this?
>
>
> ************** Exception Text **************
> System.NullReferenceException: Object reference not set to an
> instance of an object.
> at System.Windows.Forms.DataGrid.AddNewRow()
> at System.Windows.Forms.DataGridAddNewRow.OnEdit()
> at System.Windows.Forms.DataGrid.Edit(String instantText)
> at System.Windows.Forms.DataGrid.Edit()
> at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
> at System.Windows.Forms.Control.NotifyEnter()
> at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()

Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #7

P: n/a
Ok but that is going to take a bit as I have to pull all the SQL connections
and change them to OleDb(Access) to prevent password problems.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Thanks but the code is incomplete and thefore I cannot run it. Please send
entire form.

Regards - OHM#
scorpion53061 wrote:
I just emailed you.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:e4**************@TK2MSFTNGP12.phx.gbl...
Either send the code zipped and I'll try it or paste the relevant
code here. You ARE running code which is causing this error, it's
possibly in the Form_Load event

OHM#

scorpion53061 wrote:
That is the thing though......

I set hte grid to be read only in the designer. You can't add a row.

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in
message news:uf**************@tk2msftngp13.phx.gbl...
> Looks like you are trying to pass add a row to your datatable but
> the row must not reference a row object. You probably forgot to use
> 'New'.
>
>
> System.Windows.Forms.DataGrid.AddNewRow()
>
>
> Regards - OHM#
>
>
>
> scorpion53061 wrote:
>> This exception occured while running in the development
>> environment. The debugger didnt catch it though it appeared as a
>> message box prompt........does anyone have insight on this?
>>
>>
>> ************** Exception Text **************
>> System.NullReferenceException: Object reference not set to an
>> instance of an object.
>> at System.Windows.Forms.DataGrid.AddNewRow()
>> at System.Windows.Forms.DataGridAddNewRow.OnEdit()
>> at System.Windows.Forms.DataGrid.Edit(String instantText)
>> at System.Windows.Forms.DataGrid.Edit()
>> at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
>> at System.Windows.Forms.Control.NotifyEnter()
>> at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()
>
> Regards - OHM# On**********@BTInternet.com

Regards - OHM# On**********@BTInternet.com


Regards - OHM# On**********@BTInternet.com

Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.