|
s[i]= int.Parse((string)ran.Text);
this is working for me, i dont know whether it is correct type casting or not
|
|
|
|
|
How do i select which windows form opens 1st in a project?
I have a create, home, and track form and currently the home form opens first where i obviously want the create form to open 1st.
Thanks
|
|
|
|
|
You can change it in Program.cs file
|
|
|
|
|
|
You will see the code like that in Program.cs
<br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new Form1());<br />
}
So, change form1 to the form name you want.
eg:
<br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new FormThatIWantToShow());<br />
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Thanks
|
|
|
|
|
hello
I have a network that contains about 50 computers.then I want to connect to
one of this computers with it`s telnet . also i want to do this with c#.
please help me.
|
|
|
|
|
|
my application listens for socket connections. client can open socket connections and transmit messages. it connects to another server to get updates. each second my application get 300-400 data updates filters them and tranmits the updates to the connected clients same filterred 10 to 12 updates to each clients.
When 500 clients connected to my application its cpu use was 40-80% memory use 15 MB but after 3 hours I get windows error. some window apprears saying "This application encountered some problem needs to shut down. Sorry for the enconvience." Amazingly my app is running happyly no change in cpu and mem uses. When i close the error window it shuts my app.
This is a multithreaded application. I checked for deadlocks confident that there is none and .net 2 handles deadlock itself. Confident that there is no memory leaks. Application totally written in C#.
Can anybody help how to ger rid of this windows error?
|
|
|
|
|
shahidul.haq wrote: and .net 2 handles deadlock itself
How is .NET supposed to do that (generally)?
First thing to do is to find out the unhandled exception that's being thrown. Usually an unhandled exception is the reason for "This application encountered some problem...", but without the exception only looking into a crystal ball can help you.
Did you check the other properties of the process at runtime? GDI Handles and USER objects come to mind. When they're used and not disposed of correctly, the app will run out of handles after some time.
But once again: It's impossible to tell without seeing code.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have a winApplication which has a form.
In that form I have a sql data adapter which contains 4 command for select,update,delete,insert.
When I execute insert command, with passing 9 parameters values, by use of executenonguery function I receive "procedure or function "procedure name" has too many argument specified" error massage at line of executing.
What should I do? I don't know what's happend there cause I check every parameters by breakpoint and saw that every parameters were passed!
|
|
|
|
|
#1. maybe, the parameters that you are sending from code are more than the actual parameters of stored procedure.
OR
#2. try to call the stored procedure with fully qualified name. (eg: dbo.myStoredProcedure or mydb.dbo.myStoredProcedure )
OR
#3. check-out this article[^] if you are using Datagrid view or ObjectDataSource
Hope it helps...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
hey guys ! I have like 20 forms in my project that all are pretty much the same, so i'm looking for a way to doublicate them(Like in delphi)! I tried to add Inherite forms but when i do that I just get the controls not the code !!
plz help me out
Thanx
Mr.K
|
|
|
|
|
mrkeivan wrote: I have like 20 forms in my project that all are pretty much the same,
Why not use only 1 form if all forms are the same?
mrkeivan wrote: so i'm looking for a way to doublicate them
What about "Copy and Paste"?
mrkeivan wrote: I tried to add Inherite forms but when i do that I just get the controls not the code !!
Yeah. This is the way it is.. this is like inheriting the base class. When you inherit the base class, the new class won't get the code but it access its parent functionalities.
What about creating a user control?
If the most of things (controls, layout) are the same, you may probably create one user control. Place this control in all forms.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
There is posisbility to use inherited forms. (In the new item window). I tried to use this, but it does not work well with the form designer view (unfortunately). You can try to put all functional stuff in a separate class and use an object of this class in your form. You even can attach alle controls to control functionality you define in this class.
Rudolf Heijink
|
|
|
|
|
Rudolf Jan Heijink wrote: but it does not work well with the form designer view (unfortunately).
ya. me too.. it sucks..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I hava a page,named TaskConf,there is a System.Windows.Forms.Timer timer1,and there is a funtion named SetTmier() to Start timer1
public void SetTimer()
{
timer1.interval = 60000;
timer1.Ticked += new EventHandler(Task_refrush);
timer1.Enable = true;
}
The funtion Task_refrush is the event funtion,which is belong to page TaskConf.
In the other page login I call TaskConf Constructor,and then Start two thread to Start SetTimer and Task_refrush which ara belong to TaskConf:
TaskConf tc = new TaskConf();
.
.
.
..
...
Thread t1 =new Thread(new ThreadStart(tc.Task_refrush));
t1.Start();
Thread t2 = new Thread(new ThreadStart(tc.SetTimer));
t2.Start();
I found these two threads are all running,The code in Task_refrush and SetTimer is excuted,(TaskConf is not open,but constructed,only the page login is open),the timer1 in TaskConf is started,but why the timer1 does not run the funcion Task_refrush every minute?Why?
|
|
|
|
|
supercsharp1 wrote: I hava a page,named TaskConf,there is a System.Windows.Forms.Timer timer1
Are you using Windows.Forms.Timer in ASP.NET Webpage??
If you are calling the start() function of timer in constructor of the form, Tick() event of timer will get fired without showing the form...
public Form3()<br />
{<br />
InitializeComponent(); <br />
timer1.Start();<br />
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
how can i encrypt a string into binary and save it into Database as binary???
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Have a look at http://www.codeproject.com/useritems/Encrypt_an_string.asp
|
|
|
|
|
thankx
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
I am opening about 70 web pages and pulling about 1000 strings from each. My arrays tend to be 60,000 to 100,000 string arrays.
The problem I am having is this is very slow. I am using RegEx to get the 1000 names from each web page, and then putting them into a SQL database.
How do I speed this process up, it takes around 20 minutes.
I think one major slow down is I am inserting them into the database one by one. Is there a way to fix this piece? Will stored procedures help?
Is there a faster way to implement a RegEx like solution to speed up the string collection?
Is the fact that I am using an ArrayList the huge slow down?
Any help, suggestions, articles, anything, would be greatly appriciated.
Thanks!
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I have some suggestions for you.
#1. It might be slow down because of Regular expression. Using regular expression is good but it is totally depend on how you write.. I have seen a lot of regular expressions that makes the application slows.. so, my advice is that maybe you can double check the regx that you are using ... but yeah. if you are a master in regx then this is not the fact..
Expert Coming wrote: I think one major slow down is I am inserting them into the database one by one. Is there a way to fix this piece?
#2. You should not open and close the connection each time you are inserting the data. You can open one connection and then, just keep on using the connection that you have opened. after insertion done, you can close this connection..
Expert Coming wrote: Is the fact that I am using an ArrayList the huge slow down?
I think ArrayList should be okay. I'm not sure what else we should use instead of ArrayList. you are using Generic ArrayList.. right??
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Expert Coming wrote: I think one major slow down is
There's one saying: To think means to know sh*t There's also one about optimalizations: measure, measure, measure. Get a profiler, or even use the Stopwatch to find out what really slows the code down. It could be regex, it could be database, it could be ArrayList, it could be because it's weekend.
btw, use StringCollection or generic collection (like List<String> etc), because good ol' ArrayList works with objects, so it does all the slow things like casts and boxing.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
If things are slow the culprit is either regex or the database access (or both),
certainly not the ArrayList. One more possibility is you are exhausting memory
causing lots of disk accesses (I trust you would notice that).
Now 20 minutes for 100K strings is way too much, so maybe you wasted lots of time
everywhere. It may help to do the following:
- check for linear behavior: does doing half the job (half as many strings) take half
the time ? if not, something is deteriorating, maybe you selected a non-linear
algorithm somewhere, and maybe you created some memory leaks.
- get accurate time measurements on all the steps for one of the strings (but not
the very first one), so add log statements everywhere and look for the biggest
gap in time. A log statement could be:
if (stringCount==100) log("going to create regex");
and then you need to add the method to every class concerned:
public static void log(string s) {
Console.WriteLine(DateTime.Now.ToString("hh:mm:ss.ff")+" "+s);
}
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|