Best Pratice Newbie Question Regarding Custom Classes

I'm a newbie programmer so this might be a bit of a no-brainer for you experts, but I'm just looking for some guidence in regards to custom classes.

I created a class file called shipping.vb that lives in my App_Code folder

The Namespace in the shipping.vb file is called:
MyCompany.ProgramMnagement.DataLayer

I also have a public class within that namespace called 'shipping' and a function called 'InsertShippingRecord'.

In my code behind I do something like this to instantiate my class and use that function.

Dim myShippingClass As New MyCompany.ProgramManagement.DataLayer.Shipping()

I then write the following to utilize the InsertShippingRecord function of my shipping class:

Dim insertNewShippingRecord As Int32 = myShippingClass.InsertShippingRecord()

This all works perfectly.  No problems.

My quesiton is... is this the best way to do it?  

The other night I was thinking that maybe I could import the class, similar to the way I import System.Data.SqlClient at the top of my code behind page.  It sounded like a good idea but I'm not sure.

Any feedback would be greatly appriciated.
cdemott33Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GuitarRichCommented:
to instantiate your class you can reference it using the namespace like you have done or import the namespace so you only have to use the class name. Either is perfectly acceptable. I generally import the namespaces as I feel the code is a bit more readable if you don't have to put the namespace everytime you want to use the class.
There is no performance benefit to using either method that I know of.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CodeCruiserCommented:
I think you would be better using the LINQ or the Entity Framework.

http://msdn.microsoft.com/en-us/library/bb397897.aspx
http://msdn.microsoft.com/en-us/library/bb397897.aspx
0
CodeCruiserCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.