|
Great. Thanks. I've included both the try/catch and the ThreadException code -- we'll see how it runs this afternoon!
|
|
|
|
|
I handle exceptions using:
AppDomain.UnhandledException,
System.Windows.Forms.Application.ThreadException,
and a catch-all handler in void Main().
This gets all unhandled exceptions (well, except for some that are swallowed by Windows Forms/COM in the Drag* events - put catch handlers in all Drag* event handlers).
|
|
|
|
|
Thanks Daniel -- this is now how the application works (I previously only had AppDomain.UnhandledException, thinking that it would get all unhandled exceptions). Since I don't (currently) do any drag events, I should be OK (but I'll keep it in mind for future projects).
--G
|
|
|
|
|
Hi.
I have a DataGridView, now I want to use edit feature of it.
for save changes to DB, the way that I know is that read all rows of DataGridView and update all rows in DB (even rows that have no changes)
What is better way, that only changes be updated?
Best wishes
|
|
|
|
|
I use this in the CellLeave event to update the underlying dataAdapter. Before calling this however, I loop through the grid to ensure that no values being updated are going to throw up errors.
<br />
dataAdapter.Update(table);<br />
|
|
|
|
|
I hope that sounds right? I will explain...
I have built a class (lets call it 'X') that constructs a StringBuilder and then passes it back. All is OK except within this class it calls a number of methods from a base class higher up.
Here comes the tricky bit. Class 'Z' overrides a number of these base class methods, then calls 'X'.
There are also several versions of 'Z' each doing similar things but with subtle differences.
Question: Is there a way of calling the overridden methods in the parent class 'Z' from the child 'X'...?
Thanks in advance,
Phil
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Phillip Hodges wrote: Is there a way of calling the overridden methods in the parent class 'Z' from the child 'X'...?
Yes, just call them. If they are declared as virtual in the base class and override in the derived class then the correct version will be called. i.e. The version defined in the concrete class. That is to say the version of the real object, not its base.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thanks for the quick response... Yeah, I made a silly mistake... It is working fine now...
Thanks again,
Phil
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Phillip Hodges wrote: lets call it 'X'
Actually, lets not - it just complicates things and takes therm out of context. Im sure you use a descriptive name in your code (like MyStringCreator or something) so why not use it here to help people understand the context in which you are writing code.
|
|
|
|
|
I have a gridview that contains a checkbox for a user to select his choice.
I want a code that enables user to check all and uncheck the check box at ones
I am using ASP.net and C_sharp.
Please advice
|
|
|
|
|
You want to do this without postback ? You need to write javascript to do it in that case, which is a little involved, you need to get the id's of the input controls, so you can look them up and set their state.
BTW, you should ask in the ASP.NET forum, and only there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for your time. Yes ,its with out postack.Dont you think it can be done in cSharp.
Thanks
|
|
|
|
|
kibromg wrote: Dont you think it can be done in cSharp.
Of course not. Your C# code is not called unless you do a postback.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian ,
I will try and get a javascript.
Best regards
|
|
|
|
|
|
1. I don't mean to be a snob, but English is the only language used here. I don't know why you started off in English and then lapsed into Spanish(?).
2. This looks like an SQL question. You're better off posting it in the right forum.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
As addressed before, please use English. Also, please give your message titles some meaning. Make sure you place your message in the correct forum.
______________________
stuff + cats = awesome
|
|
|
|
|
This is SQL 101, I recommend buying a book on SQL and working through it. Even the books online that come with SQL Server will cover this for you.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
you did show your message both in English and in Spanish.
There is nothing wrong with that.
As far as I am concerned, you can write in whatever language(s) you choose;
the fact remains you are most likely to get answers if English is used (also).
I am sorry you felt compelled to remove it.
|
|
|
|
|
Luc Pattyn wrote:
you did show your message both in English and in Spanish
Did he? I thought he started off in English and then went into Spanish.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
IIRC there where two English sentences, followed by their exact translation into
Spanish, then followed by a Spanish sentence saying "I would appreciate getting
an example" (my knowledge of Spanish is very limited, I did however recognize "ejemplo")
That one sentence was the only thing missing in the English version.
BTW: the forum guidelines (the first topic in the C# forum, by Chris)
as well as the article by Pete dont require you use English or English only.
Of course switching languages in the middle of a post would be a bad idea...
|
|
|
|
|
I'd have thought it was implicit by virtue of all the other posts being in English. I do think it's important to be tolerant of posters for whom English is not their first language, but I also think that we can't possibly have forums where people post in lots of languages, which, mostly, most of us will not understand.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
I am not sure what the "right" attitude is; being tolerant is certainly part of it,
bashing other languages is not. Maybe the basic question is: do we want
Chinese, Russian, French, ... programmers develop their own "CodeProject" sites
(segregation), or do we endorse one programmers community (integration) ?
One thing is clear to me, we should not expect the whole world to speak
one common language, that is just not realistic; and consider, if (and by the time)
we did it probably would be Chinese, not English.
I happen to live in the European Community, I know what language issues are
about. We are finally learning to work together, and we achieve that without
imposing a single language. Unfortunately, we do have a notion of "working
languages", the ones in which official EC documents can originate, and
the "other languages" (such as Dutch, my native language).
When I Google for something I find most hits are in English, but often some
are in French, German, ... and even some languages I cant recognize (because
I dont know them and/or my system does not have the fonts to show them properly).
It is a global world, wether we like it or not.
If the same were true for CodeProject, so be it.
We will have to let the wise men decide, or let it grow whatever way it grows...
BTW: I tend to answer in the language of the question (if I know it sufficiently),
even so if I know very well the OP speaks Dutch or French.
That's out of courtesy towards the other members.
|
|
|
|
|
Hello -
I'm trying to convert the code on this page:
http://msdn2.microsoft.com/en-us/library/aa379608.aspx
to C#.
Does anybody know if there is a better way to do this and/or have any pointers for me?
Right now, I am stuck on this section:
<br />
if (bDaclPresent)<br />
{<br />
if (aclSizeInfo.AceCount)<br />
{<br />
for (i=0; i < aclSizeInfo.AceCount; i++)<br />
{<br />
if (!GetAce(pacl, i, &pTempAce))<br />
__leave;<br />
<br />
if (!AddAce(<br />
pNewAcl,<br />
ACL_REVISION,<br />
MAXDWORD,<br />
pTempAce,<br />
((PACE_HEADER)pTempAce)->AceSize)<br />
)<br />
__leave;<br />
}<br />
}<br />
}<br />
<br />
<br />
pace = (ACCESS_ALLOWED_ACE *)HeapAlloc(<br />
GetProcessHeap(),<br />
HEAP_ZERO_MEMORY,<br />
sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(psid) -<br />
sizeof(DWORD));<br />
<br />
if (pace == NULL)<br />
__leave;<br />
<br />
pace->Header.AceType = ACCESS_ALLOWED_ACE_TYPE;<br />
pace->Header.AceFlags = CONTAINER_INHERIT_ACE |<br />
INHERIT_ONLY_ACE | OBJECT_INHERIT_ACE;<br />
pace->Header.AceSize = sizeof(ACCESS_ALLOWED_ACE) +<br />
GetLengthSid(psid) - sizeof(DWORD);<br />
pace->Mask = GENERIC_ACCESS;<br />
<br />
if (!CopySid(GetLengthSid(psid), &pace->SidStart, psid))<br />
__leave;<br />
<br />
if (!AddAce(<br />
pNewAcl,<br />
ACL_REVISION,<br />
MAXDWORD,<br />
(LPVOID)pace,<br />
pace->Header.AceSize)<br />
)<br />
__leave;<br />
Thanks a lot!
|
|
|
|
|
I'm not very good at c++ but I think this syntax means the code is identified in c++.in c# there is a middle language that makes converting easy.there must be somthing like this in c++ too.
about using google maps .my problem is somthing else I want to show any kind of map in c#.do you no any way to disighn such a control in c#?
sarv
|
|
|
|