473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem(Please Help)

Ok boiled down this is the problem.........

in a module I declare a dataset.

Public dscopy as new dataset 'generic dataset

Public chitem as String 'item being selected

Public newcol as DataColumn 'generic datacolumn

In the form I fill a dataset called dsfavorites1 and then do this:

dscopy = dsfavorites1.Copy
newcol = Dsfavorites1.Tables(0).Columns("ITEMNO")

dscopy now contains the data and structure of dsfavorites1.

in the datagrid click event I say

Dim i as Integer
chitem = DataGrid1.Item(DataGrid1.CurrentCell)
For i = 0 To dscopy.Tables(0).Rows.Count - 1
If chitem =
dscopy.Tables(0).Rows(itemcheck).Item(newcol.Colum nName) Then
Label3.Text = chitem
Else
Exit Sub

everything seems fine until I go to click another button. THen I get this
prompt....

This exception occured while running in the development environment. The
debugger didnt catch it though it appeared as a message box
prompt

************** 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
2 913
Figured it out..........

There was nothing wrong with the code except when I disabled controls during
a particular operation it would have been helpful if I had remembered to
turn them back on.......

:(

"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Ok boiled down this is the problem.........

in a module I declare a dataset.

Public dscopy as new dataset 'generic dataset

Public chitem as String 'item being selected

Public newcol as DataColumn 'generic datacolumn

In the form I fill a dataset called dsfavorites1 and then do this:

dscopy = dsfavorites1.Copy
newcol = Dsfavorites1.Tables(0).Columns("ITEMNO")

dscopy now contains the data and structure of dsfavorites1.

in the datagrid click event I say

Dim i as Integer
chitem = DataGrid1.Item(DataGrid1.CurrentCell)
For i = 0 To dscopy.Tables(0).Rows.Count - 1
If chitem =
dscopy.Tables(0).Rows(itemcheck).Item(newcol.Colum nName) Then
Label3.Text = chitem
Else
Exit Sub

everything seems fine until I go to click another button. THen I get this
prompt....

This exception occured while running in the development environment. The
debugger didnt catch it though it appeared as a message box
prompt

************** 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 #2
OK, at least you solved it.

Regards - OHM#

scorpion53061 wrote:
Figured it out..........

There was nothing wrong with the code except when I disabled controls
during a particular operation it would have been helpful if I had
remembered to turn them back on.......

:(

"scorpion53061" <sc****************************@yahoo.com> wrote in
message news:uL**************@TK2MSFTNGP11.phx.gbl...
Ok boiled down this is the problem.........

in a module I declare a dataset.

Public dscopy as new dataset 'generic dataset

Public chitem as String 'item being selected

Public newcol as DataColumn 'generic datacolumn

In the form I fill a dataset called dsfavorites1 and then do this:

dscopy = dsfavorites1.Copy
newcol = Dsfavorites1.Tables(0).Columns("ITEMNO")

dscopy now contains the data and structure of dsfavorites1.

in the datagrid click event I say

Dim i as Integer
chitem = DataGrid1.Item(DataGrid1.CurrentCell)
For i = 0 To dscopy.Tables(0).Rows.Count - 1
If chitem =
dscopy.Tables(0).Rows(itemcheck).Item(newcol.Colum nName) Then
Label3.Text = chitem
Else
Exit Sub

everything seems fine until I go to click another button. THen I get
this prompt....

This exception occured while running in the development environment.
The debugger didnt catch it though it appeared as a message box
prompt

************** 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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
1
by: funfair | last post by:
HI,EVERY ONE first problem, i have create a database in access 2003 it worked fine untill i have format my laptop . now im working on office 2003 on windows xp and i have norton 2006 but im...
2
by: Radu | last post by:
Hi. I am creating a user control in vs2005 which is supposed to provide a fancy gradient background - in theory, you just drop it on a form, you set the start/end colors, the gradient type, and...
3
by: ilia | last post by:
Hi All, I am a newbie in terms of Javascript, I found some code on the net to swap rows in a table using innerHTML, this works fine in Firefox but IE is complaining, after some googling around I...
1
by: rxgmoral | last post by:
dll problem,help me:) i create dll project ,the dll is Use MFC in a Static Library i hope exe call ListCtrl class from dll ==================DLL====================...
4
by: Alan | last post by:
Hi, I m working on thesis on mechanical engieering. I m using C to solve a particualr problem. I have this code underneath which is giving me problems: for (t=0;t<=maxt;t++){ printf("testing...
0
by: nt91rx78 | last post by:
Our college changes 18 weeks semester to 16 semester, so our CS professor cannot finish teaching the last important chapter which is related with my problw\em. This is program C problem Anyone...
1
by: icetalks | last post by:
have a look at this code , its for logging the user in after checking his UserName and Password. dim check as boolean = false ... ... If txtUserName.Text.Length = 0 And txtPass.Text.Length =...
2
by: violeta123 | last post by:
I am stuck! Please help It might be difficult to explain the problem via email, but I will try. I have a Win 2003 Enterprise server running with the only purpose of a membership web site...
0
by: sa6113 | last post by:
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? 1- I have installed freeSSHD in server machine? Is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.