G
Guest
this is a very newbie question re: oop - pls excuse my ignorance:
i have inserted in each of my asp.net web forms written using C# error
handing code that i would like to encapsulate in one, centralized class.
However, all of the examples i find regarding the usage of classes deal w/
inheritance.
my question is: is there a way to simply refer to methods in separate .cs
files, w/out having to use inheritance? it seems inefficient to write classes
w/ "virtual" methods and then "override" them if i never intent to use the
original methods?
For example...
try
{
// code to execute
}
catch (SqlException ex)
{
DisplaySQLErrors(ex);
}
.... where the method DisplaySQLErrors is centralized in a separate .cs file?
Thanks,
i have inserted in each of my asp.net web forms written using C# error
handing code that i would like to encapsulate in one, centralized class.
However, all of the examples i find regarding the usage of classes deal w/
inheritance.
my question is: is there a way to simply refer to methods in separate .cs
files, w/out having to use inheritance? it seems inefficient to write classes
w/ "virtual" methods and then "override" them if i never intent to use the
original methods?
For example...
try
{
// code to execute
}
catch (SqlException ex)
{
DisplaySQLErrors(ex);
}
.... where the method DisplaySQLErrors is centralized in a separate .cs file?
Thanks,