Dmitry,
You can pass a DataSet by reference without using the "out" keyword. The thing to be wary of when doing so is that you cannot create a new instance of that DataSet in your method. Once you do that, the reference is lost. Look at it this way:
DataSet ds = new DataSet();
ds is in a particular spot in memory.
MyClass.MyMethod(ds);
Now you've told MyMethod where that ds is, its particular spot in memory.
MyClass.MyMethod( DataSet ds)
{
ds = null;
}
Now you've created a new instance, it has a totally different spot in memory.
So when you test ds for null:
if (ds =!null)
That first ds is still in its original spot in memory. That's what you're testing. Not the new ds that got created in your method in a totally different spot in memory.
If you want to create a new instance of an object in a method and pass that object in a parameter, then you have to use "out" (as Viv showed). If you don't create a new instance of that object, then you're just passing the reference to its spot in memory and all is good ... no "out" necessary.
Make sense?
~~Bonnie