|
What's that last line for? This isn't HTML and the type given for a list isn't a tag.
You can't just take two collections of different types and force one of them to be converted.
You'd need to iterate over the List of strings and add them one by one.
He who makes a beast out of himself gets rid of the pain of being a man
modified on Tuesday, April 22, 2008 5:20 AM
|
|
|
|
|
This is convert List<object> to ArrayList.
<br />
<br />
<br />
List<object> myListObject = new List<object>();<br />
myListObject.Add("123");<br />
ArrayList myStringList = new ArrayList(myListObject.ToArray());<br />
<br />
<br />
</object></object>
Convert List<object> to List<string> without loop I don't have idea.
But you write class name "List", I don't know what is it.
|
|
|
|
|
Although that works, that would be the same with any ArrayList as they accept any and all objects (not typesafe) and I think you have missed the point there. Pretty sure the guy wanted generics, and if he is using .NET 2.0 and above (he must be to be using List in the first place) then he should not be using ArrayList.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Sorry about "" - I dont know how this happened.
|
|
|
|
|
I had a situation where I had to write a Windows Service which runs on a computer which is part of a network, the service runs under Local System account and starts another application upon its startup.
Now the problem is that when I log on into that system hosting service using a remote desktop connection, I don't find the application started by the service, but when I connect to that system into the windows current session using "mstsc /console" command on command prompt, the system shows me the application started by the service.
Regards,
Talha
Muhammad Talha
|
|
|
|
|
Hi,
iam in windows application.
i have DateTime Picker Control...i hvae to select the value from that control,pass the value thru parameters.
string kc=datetimepicker1.value.ToShortDateString();
param = new FbParameter("@kc", FbDbType.Date);
param.Value = kc;
cmd.Parameters.Add(param);
it's giving error "Conversion error form string "2008-04-22" like that.
please post reply.
murali krishna
|
|
|
|
|
Try not converting the date to a string. Add it as a DateTime value to param.
param = new FbParameter("@kc", FbDbType.Date);
param.Value = datetimepicker1.Value;
cmd.Parameters.Add(param);
|
|
|
|
|
Hi,
Working with WinForms, I have a ToolStrip for which I add ToolStripButtons in runtime. I have 2 problems:
1. When the mouse hovers over these ToolStripButtons they constantly flicker.
2. I need to click them twice or three time to invoke the method that is assigned to the MouseClick event.
Is this caused by adding the ToolStripButtons in runtime?
Thanks,
Yoav Ben Zvi
modified on Tuesday, April 22, 2008 3:30 AM
|
|
|
|
|
Hi Yoav,
I have tested this issue, but it works well. I was not able to see this issue here. Please send your sample code, it will helps to solve the problem earlier.
Thanks,
Gopal.S
|
|
|
|
|
th eproblem seems to be with another control teking focus. Thanks anyway.
|
|
|
|
|
Hi
Can Anyone help me for the following Issue?
How can i nvoke a method of a dll written in VB6.0 using C#.net Application?
Tahnks in Advance
sri
|
|
|
|
|
p/invoke.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hii friends ..
I am facing a problem related to AJAX. I am using two dropdownlist,
on change of first dropdownlist, I am filling the second dropdownlist.
But sometimes it fills the second dropdownlist and sometimes shows it empty. Is it something related to ajax dll or something else..
thanking you ..
|
|
|
|
|
It could be in part that you're asking in the wrong forum ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I'm working on a .net2.0 windows application. When I applied a image of size 25KB as background, performance of the application is getting reduced. When I remove that image, it works fine.
Please let me know the solution. Thanks in advance.
|
|
|
|
|
Use a smaller image ? It's hard to work out why the background image is having this affect, what does the app do ? What reduction are you seeing in performance ?
Also - be aware that 25k on disc means nothing. It's width * height * 3 bytes in size in memory, at least.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
At first, I used 400K image as background. I found that it is causing the performance reduction. So, I used 25K. Eventhough, I found the same performance reduction in the application.
I observed Performance reduction while form load. And when I press Spin command button, around 36 buttons should rotate along a cirle. The movement become very slow, when image applied.
The thing makes me surprise is there is same amount of performance issue for both 400K and 25K size of images.
Hope you understood the scenario.
|
|
|
|
|
It might not be a problem with the image itself, it could be a problem with how you are manipulating the image. Based on the description of the spin command, it sounds like that itself could be causing the performance slow down.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Have a form, using either an image/color + transparency key, I have a transparent form. Fine.
However, I have these nice little png images, I want to place on that form as buttons, and maybe even place over the buttons to convey information.
Only problem is, that where the png alpha (like in the edges of the drop-shadow) overlaps the form, I get a weird mix of the drop-shadow, and the transparency key.
Any suggestions?
|
|
|
|
|
Use Paint.NET
http://www.getpaint.net/[^]
If you use the eraser on the White text, it gives a checkerboard effect. This checkerboard effect is in-fact transparency.
Use these modified images, instead.
Should help
|
|
|
|
|
Using c# 2005 Express Edition:
I am writing a service that copies files to an AD share and am having a bit of a problem with the .net built in accounts with the windowsinstaller and framework found here:
http://www.codeproject.com/KB/system/WindowsService.aspx[^]
I was told (by a network admin) that the "localService" account will provide the computers credentials when accessing AD shares, but, the IDE states that I am supposed to be using the "NetworkService" account.
The "NetworkService" account fails and .net puts an error in the event log:
[code]
EventType clr20r3, P1 windowsservice.exe, P2 0.0.0.0, P3 480d4ccb, P4 mscorlib, P5 2.0.0.0, P6 4333ab80, P7 32f8, P8 15a, P9 system.unauthorizedaccess, P10 NIL.
[/code]
Other than having to run my code in a seperate thread and this account thing I have not come across any unexpected issues; posting code is not going to help with this one (yeah, I am a bit lazy too)
I do not have access to an AD at this point and am looking for some general advice from those in the know.
Thank you for reading.
shwaguy
|
|
|
|
|
anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone? anyone?
FTARH was a great movie
|
|
|
|
|
Heya all-
Has anyone else run into a NotImplementedException when you try using the Graphics.DrawImage method overload that takes an Image and an array of Points defining a parallelogram? This should be the simplest thing in the world...I have an Image, and I have four (valid) points describing a parallelogram.
I have found a few references regarding the Dpi of the image compared to the Graphics pointer, but they're the same (at a lovely 96 dpi). So...yeah...good times.
*sigh*
|
|
|
|
|
Wow - you can use Reflektor to look at the .NET source.
It looks to me like those methods ultimately call this:
<br />
public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)<br />
{<br />
if (destPoints == null)<br />
{<br />
throw new ArgumentNullException("destPoints");<br />
}<br />
if (image == null)<br />
{<br />
throw new ArgumentNullException("image");<br />
}<br />
int length = destPoints.Length;<br />
if ((length != 3) && (length != 4))<br />
{<br />
throw new ArgumentException(SR.GetString("GdiplusDestPointsInvalidLength"));<br />
}<br />
IntPtr handle = SafeNativeMethods.Gdip.ConvertPointToMemory(destPoints);<br />
int errorStatus = SafeNativeMethods.Gdip.GdipDrawImagePointsRectI(new HandleRef(this, this.NativeGraphics), new HandleRef(image, image.nativeImage), new HandleRef(this, handle), destPoints.Length, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, (int) srcUnit, new HandleRef(imageAttr, (imageAttr != null) ? imageAttr.nativeImageAttributes : IntPtr.Zero), callback, new HandleRef(null, (IntPtr) callbackData));<br />
Marshal.FreeHGlobal(handle);<br />
this.IgnoreMetafileErrors(image, ref errorStatus);<br />
this.CheckErrorStatus(errorStatus);<br />
}<br />
Looks like it should work to me.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Doh!
Yep, another one of those errors.
For some reason I was reading 'parallelogram' as 'polygon' - which meant that the four points I was putting in was causing it to choke. Ugh. After actually reading the documentation on that function, it's working.
Thanks for the help Chris.
|
|
|
|