|
i create multithread about 100 thread to read text file base
and load data is match regulare expresstion but sometime result about
5000 answer sometime result about 7000 not reliability how to program this?
|
|
|
|
|
This is due to data collision.. you could try ReaderWriterLock class, monitor lock , Synchronization Locks
|
|
|
|
|
Hi! I have a question, I have a WIN app, and I am loading an xml document within that form. Then I have another form, what I can reach with pressing a button on the first form. I have there few fields, what I need to fill in, and I want to gather the data from the XML document what is loaded in the previous form. Is that possible?? Thx
|
|
|
|
|
You should create a Static class with static variables in it, and then create a method to load data from xml file to variables available in this static class let call it MyLoad() function.
Call this MyLoad function from the first form and load xml file in this static class. Now you may access and share data from both of the forms using this static class.
You may directly access variables of this class without any object such as-
MyStaticClass.Variable1=”Some Value”;
I hope this helps .
-Ajay.
-------------------------
www.componentone.com
-------------------------
|
|
|
|
|
i have stored procedure from SQL have bit parameter returns 1 or 0,
the parameter works fine on SQL
on C# i have problems, as the following:
SqlCommand checkDone = new SqlCommand();
checkDone.Connection = con1;
checkDone.CommandType = CommandType.Text;
checkDone.CommandText = "checkCompatability";
SqlParameter complete = new SqlParameter("@award_num", SqlDbType.Int);
complete.Direction = ParameterDirection.Output;
complete.Value = int.Parse(comboAwardNum.Text);
SqlParameter comp = new SqlParameter("@compatability", SqlDbType.Bit);
comp.Direction = ParameterDirection.Output;
bool mybool=bool.Parse(comp.Value).ToString();//error here
lblresult.Text = comp.Value;
checkDone.Parameters.Add(complete);
checkDone.Parameters.Add(comp);
checkDone.Connection.Open();
checkDone.ExecuteScalar();
checkDone.Connection.Close();
how to return parameter value from SQL?
thanks
|
|
|
|
|
What is the error that is thrown?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
can not convert from object to bool
|
|
|
|
|
Well I guess you can make a check like:
bool myBool = comp.value==1?true:false
Muhammad Talha
|
|
|
|
|
Mr.Kode wrote: checkDone.CommandType = CommandType.Text;
This should be checkDone.CommandType = CommandType.StoredProcedure;
You're creating output parameters so they won't take input. You can make them InputOutput parameters to take values and then they can alter them.
Mr.Kode wrote: bool mybool=bool.Parse(comp.Value).ToString();//error here
This line of code has multiple errors. comp.Value is object and Parse takes a string parameter. comp.Value is object and has not been set. Another error in this line is that after you "parse" to bool , you're using ToString() and assigning it to bool
You retrieve values from the output parameters after the command has been executed. And it would be
bool mybool = (bool)comp.Value;
The same for the other SqlParameter.
Mr.Kode wrote: checkDone.ExecuteScalar();
Why ExecuteScalar? Use ExecuteNonQuery if you're not retrieving a value.
And this question should have been asked in the SQL / ADO / ADO.NET forum
Eslam Afifi
|
|
|
|
|
hi
i have a datagrid with a hyperlink column.and "checkboxes"
when i check the checkbox the record will be deleted.so in this context i want disable the "hyperlink" when the chechbox is checked.
how to write the code can any any one help me.
|
|
|
|
|
csp wrote: i want disable the "hyperlink" when the chechbox
You can actually replace the href with a javascript:void(0) programmatically. But that would irritate the user since if he would try to click and nothing will happen. How about alerting the user when the checkbox is clicked, the hyperlink would not work.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
when check box is checked the corresponding record gets deleted logically in database.so no other events(like edit)has to be generated.this hyperlink redirects to other web page.this should not happen when checkbox is checked.
i have done for edit command,but for hyperlink i don't know what to do.
|
|
|
|
|
thank u i got it.but not using css.
any ways thanks.
|
|
|
|
|
Hi All,
I wrote code for class assembly named FTPUtility.dll using C#. After that i just rename that FTPUtility.dll file and used it in my application as reference. but it gives the error message
"Could not load file or assembly 'FTPUtility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
Anybody can tell me why this error occured.
Pravin
|
|
|
|
|
Is the error observed in Visual Studio Build Output window?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
no, error does not appear in Build output window. it occures at the runtime
Pravin
|
|
|
|
|
Are you renaming after adding as a reference and building? It will naturally fail then.
Why are you renaming the DLL?
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
No, first i rename that dll file and after that i have added it as reference. It compiles fine. but shows FileNotFound exception at run time.
error message is as follows....
"Could not load file or assembly 'FTPUtility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
Pravin
|
|
|
|
|
You need to remove the reference to FTPUtility and add it again
|
|
|
|
|
|
The .Net framework doesn't like it when you rename a file without changing the assembly metadata so that the two correspond. That's what is causing the error. To fix it, go into the project properties of FTPUtility and change the assembly name field to the new filename. Then rebuild the project and replace the DLL file
|
|
|
|
|
I have a windows forms app which goes and does some processing. While this processing is being done I have created a progress form which I want to show the current progress (this is not working correctly).
The code is:
ProgressForm frm = new ProgressForm();
frm.ProgressText = "Do step 1...";
DoStep1();
frm.ProgressText = "Do step 2...";
DoStep2();
frm.ProgressText = "Do step 3...";
DoStep3();
frm.ProgressText = "Completed";
This code will show the progress form, but it will not update the label text until all the steps have completed, then the progress form show "Completed", while the processing is still happening it shows nothing. Anyone know a solution?
thanks
|
|
|
|
|
You don't give your label a chance to paint itself because the main (UI-)Thread is busy performing your steps.
Either put a call to Application.DoEvents(); after each text update (beware - that's the quick&dirty way that can lead to other, unexpected problems) or do it correctly: Put the calls to DoStepN() into a separate thread so your UI will remain responsive. The class BackgroundWorker makes it quite easy.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi All,
How to send the video frames as bytes across the network using tcp/udp/or any sockets using Directshow.
How To use IsampleGrabber in Directshow.?
Thanks In Advance.
SHINOJ
|
|
|
|
|
i have some listview item and i have on this listview 2 column.
I want to insert my item into the listview in some way that each of the column will have some ( different ) text .
How can i do it ?
|
|
|
|