G 
		
								
				
				
			
		gordon
Hi
I am still fairly new to C#.net and I sometimes make basic program design
mistakes - particularyly in the context of paying attention to OOP
principles.
At the moment I am working on an application that uses a MS Access database
and runs some queries that return output to a datagrid. I would like to
consider the best structure of the program so that I can start to get into
good habits for other similar projects.
I have a few questions that I would appreciate some advice on.
First is about structure - is there a standard way of writing OOP code -
that is understandable by novices?
Second is about my particular application. At the moment I have a file
called First.cs that contains the class called 'First :Form' which in turn
contains the the main method and the click events that are fired by a user.
I also have a method within this class that is called GetData that actually
contains the OleDB commands and is passed a parameter the is used in a
'Select...' string. I was trying to move the GetData method into a class of
its own - but I keep getting errors about some of the components within the
method that generate out of context type errors. For example, I have a
dataGridView called dgMainView that will display the result of the query,
but this is not easy to reset in the new class - as are some other controls
that are on the form. Is there a simple way around this - or do I have to
set all of my form controls to public rather than private? Alternatively,
am I going about this the wrong way in general>
Thanks
Any help appreicated.
Doug
				
			I am still fairly new to C#.net and I sometimes make basic program design
mistakes - particularyly in the context of paying attention to OOP
principles.
At the moment I am working on an application that uses a MS Access database
and runs some queries that return output to a datagrid. I would like to
consider the best structure of the program so that I can start to get into
good habits for other similar projects.
I have a few questions that I would appreciate some advice on.
First is about structure - is there a standard way of writing OOP code -
that is understandable by novices?
Second is about my particular application. At the moment I have a file
called First.cs that contains the class called 'First :Form' which in turn
contains the the main method and the click events that are fired by a user.
I also have a method within this class that is called GetData that actually
contains the OleDB commands and is passed a parameter the is used in a
'Select...' string. I was trying to move the GetData method into a class of
its own - but I keep getting errors about some of the components within the
method that generate out of context type errors. For example, I have a
dataGridView called dgMainView that will display the result of the query,
but this is not easy to reset in the new class - as are some other controls
that are on the form. Is there a simple way around this - or do I have to
set all of my form controls to public rather than private? Alternatively,
am I going about this the wrong way in general>
Thanks
Any help appreicated.
Doug
