typeofOPCserver OPCserverObj = (typeofOPCserver)Activator.CreateInstance( typeofOPCserver ); ??
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
My programs never have bugs, they just develop random features.
I have the usual layers UI, objects, DAL and SQL Server.
In VB I instantiate the DAL in the object layer using a friend variable in a module. This allows me to use the DAL in any class in the object layer without exposing the DAL to the UI. DAL stays alive as long as the app is in process.
Now C# does not have the module concept and I do not want to pass the DAL to the UI to pass to each class in the object layer. I assume it is done with a static class but I am struggling to get it just right.
 What you can do is to create a public static variable on a class and use it like...
The only problem is static classes cannot have constructors, so can I declare the static class, pass values to a method that instantiates the static DAL? Then use the static DAL var in the other classes
Never underestimate the power of human stupidity
I have one class derived from ContentControl.
And inside it's content I have ImageSource and a TextBlock, I want to bind the Text property of TextBlock to the Name proeprty of an object but it's not working.Below is the code snippet:
public void AddBitmapToCanvas(System.Drawing.Bitmap bitmap, string pageName,int width,int height,HorizonPage hpage)
I can get data from SQL to datagridview, textbox and combobox objects.
I can edit or view any data from or to database with the above objects!!!
But not to StatusStrip, at least not directly!!!
I get the data from sql to other object, and then pass it to statusstrip.
Is there a direct way? like the other object. statusstrip doesn´t has a datasource