Try to use the following command line to compile it to a dll.
csc /t:library /out:..\bin\YourClass.dll YourClass.cs /r:system.dll /r:system.data.dll /r:system.xml.dll
Sincerely,
Jasson Wang
Microsoft Online Community Support
This posting is provided "AS IS" with no warranties, and confers no rights