PDA

Click to See Complete Forum and Search --> : [2.0] where to put?


arshesander
Jun 27th, 2007, 11:41 PM
where should i put?

using System.Data;
using System.OleDb;

effekt26
Jun 27th, 2007, 11:47 PM
using statements must always go at the top of your file. before any class or namespace declarations...


using System;
using System.Data;
using System.OleDb;
//etc.

namespace MyNamespace {

class MyClass {

}

}

nebulom
Jul 4th, 2007, 07:31 PM
Actually you can place it inside a namespace. But practices are top most on every file as effekt26 said.

effekt26
Jul 4th, 2007, 07:56 PM
Actually you can place it inside a namespace. But practices are top most on every file as effekt26 said.

Hmmm, I wasn't aware of that. Everything I have read said at the top, above classes...but mentioned nothing about namespaces...

I'll keep that in mind.
Thanks nebulom!

eranga262154
Jul 4th, 2007, 09:44 PM
In software programming it is good practice to follow a standard format. Normally those references are added top of the code, easy to find what type of application is there.