I was just wondering if it was possible to take a string that contains C# code and compile and use it at runtime. For example if I had a string like this:
String strCode = @" class SomeClass : SomeBaseClass {
private string firstName;
private string lastName;
public SomeClass() {
this.firstName = ""John"";
this.lastName = ""Smith"";
}
... Properties ...
}" ;
I have been reading about the CSharpCodeProvider class, however it doesn't look like you can just compile a string containing code.

Answer Dynamic Code Generation
Robert Bacs
CSharpCodeProvider.CompileAssemblyFromSource()
Regards,
Chris
TitanX
just check out the link
http://support.microsoft.com/kb/304655
it will shows the sample how to do the compilation at runtime.