|
You can't convert a collection of anything to a collection of something else:
List<string> ls = new List<string();
List<object> lo = (List<object>) ls;
Unless the collection defines a cast operator that supports it.
So you will need to explicitly define a conversion as part of your generic class:
public static implicit operator Table<object>(Table<T> t)
{
Table<object> to = new Table<object>();
...
return to;
}
How you actually do the conversion is up to you!
You will probably need to explicitly declare a conversion back again as well...
Never underestimate the power of stupid things in large numbers
--- Serious Sam
|
|
|
|
|
Thanks, that works greate for me.
|
|
|
|
|
You're welcome!
Never underestimate the power of stupid things in large numbers
--- Serious Sam
|
|
|
|
|
Hello
I have created Printer from c# and it called Myprinter How I can when user print any document show my program(redirect it to a external program) .
thanks very much
|
|
|
|
|
|
Hello
I have to use VS 2012 and C++
Or I can use VS 2010 C#
Thanks..
|
|
|
|
|
Since a driver is (effectively) part of the Windows OS you will need to write it in C/C++.
Veni, vidi, abiit domum
|
|
|
|
|
I write my project in C#.
I have to rebuild my project in C++ or there other way to create driver printer
|
|
|
|
|
If you want to create a new printer (real or virtual) then you will need to install a driver for it, and that will need to be written according to the WDK. Go to the link I gave you and study how to do it.
Veni, vidi, abiit domum
|
|
|
|
|
How to display image on crytal report using image path from folder and selection of combobox.
|
|
|
|
|
Bit by bit.
You're asking three questions here; how to display an image in CR, how to fetch an image, and how to work with a combobox. I assume that the combobox is on some WinForm?
Check out Image in Crystal Reports[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello everyone
How I can add add local printer programmactly with c#
thanks in advance
|
|
|
|
|
You have already been hiven an answer below.
Veni, vidi, abiit domum
|
|
|
|
|
Don't repost the same question again.
|
|
|
|
|
Hello
I used this code to add printer but it did not work
try
{
oManagementScope = new ManagementScope(ManagementPath.DefaultPath);
oManagementScope.Connect();
ManagementClass oPrinterClass = new ManagementClass
(new ManagementPath("Win32_Printer"), null);
ManagementBaseObject oInputParameters =
oPrinterClass.GetMethodParameters("AddPrinterConnection");
oInputParameters.SetPropertyValue("Name", "testprinter");
oPrinterClass.InvokeMethod("AddPrinterConnection", oInputParameters, null);
return true;
}
catch (Exception ex)
{
return false;
}
|
|
|
|
|
What does "it didn't work" mean?
Where did you specify what printer to connect to? What driver to use? What printer settings (port, ip, etc)? I can't imagine you would get a working printer just by telling Windows the name of one...
|
|
|
|
|
Thanks for answer
did not work mean when I execute the code and go to Printers ,I did not see any new printer.
I want to create it on local host(Client Machine)
Port:Local port.
IP:Local IP
thanks
|
|
|
|
|
|
|
No problem.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
The same way you would do it on paper. Create a List of all the points in the graph and then draw a line from the first to the last, passing through each intermediate point. You can do this by using the Graphics Class[^], or search Google for some other utility classes that may help you.
Veni, vidi, abiit domum
|
|
|
|
|
I do not plot as in the picture. No numbers only lines
|
|
|
|
|
Sorry, but I do not know what you mean.
Veni, vidi, abiit domum
|
|
|
|
|
No lines. does not seem spots
|
|
|
|