Thanks! It works now.
>Jess,
>
>>I created a project but not based on MM project. The form however was created based on MM Business Form. The problem is when I called class methods just like below it gives me an error:
>>
>>this.GetDataSet("SELECT * FROM Orders WHERE CustomerID "+sqlSOrders+" @CustomerID",
>> this.CreateParameter("@CustomerID", sqlPOrders));
>>
>>error message is:
>>
>>NullReferenceException was unhandled!
>>Object reference not set to an instance of an object.
>>
>>Note: The same object class works in different form without change.
>
>If this is a non-MM .NET project, make sure you instantiate an MM .NET application object so the form and business objects have access to MM .NET service components.
>
>You can do the following:
>
>
- Copy the App.cs file from C:\Program Files\Mere Mortals .NET Framework 2005\VC#\Templates\Windows Forms Template, copy it to your root project directory and add it to the project
>
> - At application startup, instantiate the application object before trying to access any data or display any form. For example:
>
>public static AppDesktop App;
>
>/// <summary>
>/// Main application entry point
>/// </summary>
>[STAThread]
>public static void Main()
>{
> // Instantiate the Application Object
> App = new AppDesktop();
>}
>
>Best Regards,
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net
CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."