I am a student and I dont know what a partial class
is. The following code belongs to a partial class
I automatically created the partial class:
public partial class EGUI: Form
{
private OleDbConnection dbConn; // Connectionn object
private OleDbCommand dbCmd; // Command object
private OleDbDataReader dbReader; // Data Reader object
private Emp Edetails;
private string sConnection;
private string sql;
}
First of all, THIS: http://msdn.microsoft.com/en-us/library/wa80x488(v=vs.80).aspx
Second of all, it allows a way for a programmer to collect specific pieces of code into two different files. A really good example of this is when creating an ASP.NET WebForm. The WebForm will have a file for your event handlers and such (Button_Click etc) and then you will have an extra file that contains the declarations of the ASP.NET controls you are using on your page. This keeps the code you CARE about in one file and the more obvious 'auto-generated' stuff in another.
Correct me if I'm wrong, but I also believe partial classes may allow you to do something similar to 'monkey patching' because it exposes the class in such a way that you can add new methods, variables etc and have access to the classes private members.