|
R.A.C wrote: I got an Exception with the excel file
What is the exception you get (particularly what is in exc )? Be a bit more verbose and someone may be able to help.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Paul,
I found my error with this application
By mistake I was not displaying the exc Exception, I was only displaying my own error message
After your question I notice my error and found that computer with windows 2000 had an old version of the MDAC,
I just need to run an early version and everything works OK,
Regards
Rafael
Life is Great, and kids the best
|
|
|
|
|
R.A.C wrote: windows 2000 had an old version of the MDAC
Oh yeah, those can be sometimes subtle
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi.
I want substitute of this code
this.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)( ()=>
{
this.ProgressBar.Value = e.ProgressPercentage;
}));
Is this Lambda expressions ?
Thanks in advance.
|
|
|
|
|
Mohammad Dayyan wrote: Who can help
Google
|
|
|
|
|
Yes, it is a lambda expression.
By the way, that the () => means that it has no parameters.
And why do you want to substitute it? Lambda expressions feels more natural than delegates' syntax.
Eslam Afifi
|
|
|
|
|
Hey Eslam.
Thank you very much.
Eslam Afifi wrote: And why do you want to substitute it? Lambda expressions feels more natural than delegates' syntax.
You're right.
But I don't understand lambda expression more , thus I'd like seeing substitute it for more learning .
|
|
|
|
|
You can write
(Action)(() => this.ProgressBar.Value = e.ProgressPercentage) //no casting to Action needed by the way
as
delegate() { this.ProgressBar.Value = e.ProgressPercentage; }
This article[^] helped me understand lambda expressions, linq ...
Eslam Afifi
|
|
|
|
|
Thank you very much my friend
|
|
|
|
|
You're welcome
Eslam Afifi
|
|
|
|
|
Hello,
I am trying to understand the CER feature, but I am not very confident that I understand it well. I have read a number of articles about it, but I still need to check whether I understand it correctly. I hope you could help me.
First, I apologize for this long post. I thought it is necessary to clarify my question. I'm thankful for your patience.
I am implementing a SafeHandle , and the release code looks like this:
class MySafeHandle : SafeHandle {
protected override bool ReleaseHandle() {
MyClass.freeHandle(handle);
return !MyClass.CheckErrors(false);
}
}
class MyClass {
internal static extern void freeHandle(MySafeHandle handle);
internal static extern bool checkExternalErrors();
internal static bool CheckErrors(bool throwExceptionOnError) {
if (!checkExternalErrors()) return false;
if (throwExceptionOnError) throw new Exception();
return true;
}
}
I'm not sure what to label freeHandle , checkExternalErrors and CheckErrors . freeHandle wouldn't tell whether there is an error; I have to call CheckErrors for that. But it will never throw an exception either, so I'm thinking it should be labeled [Cer.Success] .
Meanwhile, CheckErrors may throw an exception, depending on the throwExceptionOnError parameter. So I think this should be labeled [Cer.MayFail] . But I don't really know... wouldn't that violate the CER on ReleaseHandle ? Also what should I label checkExternalErrors ? Does it not need a label? Or does it still need [ReliabilityContractAttribute(Consistency.WillNotCorruptState)] ? I really feel confused!
Thanks a lot for your patience! Even if you don't answer, I'm grateful that you read this post to the end.
|
|
|
|
|
hello,
my problem is that i am working on a window app in c#.
i have three buttons on my form.now while selecting with tab button i want to
fire button1_click or button2_click event when we press enter.for 1 button it can
be easily done by form's accept button property .but how can i do it for all
|
|
|
|
|
If any button is focused and you press enter, its click event is automatically fired.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi,
First I will apologise for not answering your exact question but here is another way to achieve your goal.
Did you know that the standard windows keyboard method for simulating a keypress on the button that has focus is the space bar. Change focus from button to button with the tab key and then use space to press the button, no programming required on your part!
Alan.
|
|
|
|
|
I am a beginner in C#,this is an extract from a webservice project.i get an error Error 24 Cannot apply indexing with [] to an expression of type 'method group'.pls help wat am i doing wrong here.
1.)object[] args = new object[](this is in one method)
2.)args[2] = Row[SharedVars._MobileNo].ToString();(this is in another method)
string demo = args[2].ToString();
string mobshort = demo.Substring[0,3];
if (mobshort == 971)
string CountryCode = "U";
}
else
{
CountryCode = "O";
}
|
|
|
|
|
soniaiq wrote: string mobshort = demo.Substring[0,3];
change to
string mobshort = demo.Substring(0,3);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Thanks a lot dave,
wen i solved this i am getting other errors
if i comment this below part no errors but i need tat
if (mobshort == 971)
string CountryCode = "U";
}
else
{
CountryCode = "O";
}
|
|
|
|
|
You're missing an opening brace {
if (mobshort == 971)
{
string CountryCode = "U";
}
else
{
CountryCode = "O";
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
And you have to make declaration before "if"
string CountryCode;
if (mobshort == 971)
{
CountryCode = "U";
}
else
{
CountryCode = "O";
}
Or you can do it on one line
string CountryCode = (mobshort == 971)? "U" : "O";
|
|
|
|
|
soniaiq wrote: demo.Substring[0,3];
Should be demo.Substring(0,3);
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
Well, that really doesn't help much without knowing which lines are the offending lines. You may need to look further into the code, sometimes the problem line can have a root problem elsewhere in the code.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
Cool deal
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Good evening Everyone
My VS is behaving n an unnormal way. I have 9 Project in a Solution and i have set one of the Projects as a Startup Project and created a Setup project, after i Built it to create an exe, The Project that gets Started is not the one that i set as a Startup. The Strange this is that the Project that start is the first in the list(Solution Explorer). i rebuilt the Setup Project but still no luck. I went to the Solutions Properties and i made Sude that the Project is Selected as a Startup object, but still my Project is not selected as a Startup
What is Wrong
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|