|
InitializeComponent();
BtnOk.Click += new EventHandler(BtnOk_Click);
and my clickevent is
private void BtnOk_Click(object sender, EventArgs e)
{
//This Event Raising 2 times.....?
}
and design.cs
this.BtnOk.Click += new System.EventHandler(this.BtnOk_Click);
|
|
|
|
|
So like stancrm said initially, you're hooking the event twice.
You hooked it once in the designer, and another time in your design.cs. Either unhook it in the designer, or remove that line from design.cs.
|
|
|
|
|
yesssssssssssssssssssss
finally i got on deleting instance in designer.cs
so Thanks to everybody
|
|
|
|
|
You have not provided much context for the code snippets. Where are they coming from?
Are you saying that you have
BtnOk.Click += new EventHandler(BtnOk_Click); in your form's constructor, and
this.BtnOk.Click += new System.EventHandler(this.BtnOk_Click); in your form's design.cs file?
If this is the case it looks like you have added the event handler twice to the button click event. I would recommend removing the one in the constructor because the designer will take care of the one in the form's design.cs class.
Also, what is in the call stack when the BtnOk_Click method is called? (If you don't know where to get the call stack it is probably in Debug-->Windows-->Call Stack)
|
|
|
|
|
How very javascriptish--
anyway, check your Form.designer.cs file for BtnOk.Click+=new EventHandler(object sender, Eventargs e);
and then check your Form.cs file for the same. Get rid of one.
If you want to register that EventHandler always, leave it in the designer file, if you want to attach it if some condition is met - take it out and do it in the form.
var question = (_2b || !(_2b));
|
|
|
|
|
Narendra Reddy Vajrala wrote: Please give some solution
Its quite simple...add another button in a new project, put breakpoint and check is it calling twice or not. If it is then something wrong with your windows or your mouse is dying.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
yes,
from some other form am comming to this form and no where in my project it doesnt happend but y here only....!?
|
|
|
|
|
what are you doing to know that its calling twice ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Dear Friends,
I have small application in C#. to insert some record in a table. I am using select max(primary key) from tablenme to get the max id and insert the record with other information.
If single person work it is running properly. But if 4-5 peoples run the same application and they try to save the record some time it gives error as "ora 00001 unique constraint (constraint name) violated"
Your quick response will be highly appriciated
Regards
Murtuza
|
|
|
|
|
How long between selecting the max key and inserting the new one?
|
|
|
|
|
I don't remember the Oracle syntax for it, but the major RDBMSes usually an auto-increment or identity field of some sort. If you use that for the ID, the database will automatically generate a new value when the record is inserted.
Failing that, a few alternatives:
1) Put it all in one DB transaction using a temporary variable. That means get the next index and insert the new record as one combined operation, so nothing can happen in between.
OR
2) Create a stored procedure on the database that inserts the record and returns the ID (If you need to know the ID). Again, keep the entire operation on the database side.
OR
3) If you must do it all on the client side, catch the exception, wait a random number of seconds or milliseconds, and repeat the operation (Checking for the next ID again). This solution is less than optimal, but it's commonly used in certain network protocols.
|
|
|
|
|
If you're using Oracle, look at harnessing the power of a Sequence. This will give you a value that you can use for your primary keys.
Usually you have one sequence per table that needs a numeric primary key.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I am using a rowfilter with a dataview. How can I ascertain the number of rows which are being displayed please?
|
|
|
|
|
You can use
dataview's rowfilter property="select top 10 "
This might work fine
Thank You
Vinod(vinod8812@gmail.com)
|
|
|
|
|
|
I used DisplayedRowCount() to do the job.
Many thanks to those who took time to offer suggestions - much appreciated.
|
|
|
|
|
Dear sir,
i have two list views in window. one for local machine and second for remote machine.
first list view shows files in local machine. and second list view show files in remote machine.
i want to drag one file from first list view to second list view.
could u plz help me??
yogesh
|
|
|
|
|
yogesh_softworld123 wrote: could u plz help me??
There are a number of things here. What do you want help with?
* Listing the files
* Performing a drag/drop operation
* Performing the file copy operation
|
|
|
|
|
drag and drop
but sorry to say
now i have solved that problem
thnk you.
yogesh
|
|
|
|
|
Yogesh, this is third post of yours.... and you are still not clear what you need...
as Colin posted, which operation you need after the drag and drop....
if it is copying files( i assume this - Copping)
then have a look at this article....
Drag and drop, cut/copy and paste files with Windows Explorer
Have a Happy Coding.....
|
|
|
|
|
1. Stop calling everyone sir, we are not a bunch of knights here you know
2. Stop posting the same friggin question every 5 minutes
[EDIT]
2 1/2. Why are you even posting when you clearly are not taking anyones advice anyway?
3. Finally, and most importantly, QUIT TRYING TO BE A PROGRAMMER BECAUSE YOU CLEARLY ARE NOT CUT OUT FOR A LIFE OF USING YOUR OWN BRAIN TO SOLVE A PROBLEM WHICH IS WHAT BEING A PROGRAMMER IS ALL ABOUT!!!!!!!!!!!! (12 should do it, now to bold or not to bold...)
4. Why have you not quit yet?!?!?
<wheres the="" damn="exploding head" smiley="" when="" you="" need="">
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
sorry dear, i was in critical problem. but now i have solved that problem. and i didnt use ur ideas.
and it was my test in one company and now i got job.
thank you very much. in future i will never post any problem here.
is it okkkk???????????????????????????????????????????????????????
and go to hell
yogesh
|
|
|
|
|
you had a test to see if you could get someone to do the work for you? thats a weird one
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
dear Sir, nothing weird about it. He is applying for a managerial job.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|