|
Insufficient data, you might want to show the code.
Wild guess: you did use a timer other than Forms.Timer, and its handler
is performing an Illegal Cross-Thread operation on a control (probably the InfoForm itself).
If correct, the remedy is either use Forms.Timer or read up on Control.Invoke
|
|
|
|
|
Here is the code ... nothing spectacular
public class Info_Start : System.Windows.Forms.Form
{
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
public Info_Start()
{
InitializeComponent();
timer1.Interval = 5000;
timer1.Start();
this.TopMost=true;
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Info_Start));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(512, 360);
this.ControlBox = false;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(520, 368);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(520, 368);
this.Name = "Info_Start";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.TopMost = true;
this.Click += new System.EventHandler(this.Info_Start_Click);
this.Activated += new System.EventHandler(this.Info_Start_Activated);
}
#endregion
private void timer1_Tick(object sender, System.EventArgs e)
{
this.Close();
}
private void Info_Start_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
that's all ...
|
|
|
|
|
fracalifa wrote: nothing spectacular
I agree.
Looks fine at first glance.
Now my guess is, when it fails, it is the timer firing before the form has been completely
loaded (i.e. in the middle of loading the icon, see StackTraceBack).
Remedy might be: wire a Load event and use it to start your timer.
|
|
|
|
|
Hi Luc,
thank you.
I'll try this.
Let's see what happens after the 999th start ....
Frank
|
|
|
|
|
Hi Frank,
you could make a test setup that creates a new form which selfdestroyes after some time,
put everything in a loop, and make the delay a random number say in the range 100...5000
msec (use a static Random !!) then let this run and watch how long it lives on average
(say 3 minutes).
Now apply my (or other) suggestions to fix, and let the same test run say ten times as
long (hence 30 minutes); if that succeeds, you know you have dramatically improved things.
The whole process would take no more than 1 hour, and need little or no human intervention.
Beats launching it manually 1000 times, and not feeling sure whatsoever... (This is
assuming you manage to make the loop fail sooner or later to begin with).
|
|
|
|
|
Hi Luc,
good idea.
My feeling is that this could be a runtime problem (loading the relating lib's on the first start).
Later the lib's are in the file cache and the problem does not occur.
In parallel I will test your suggestion.
Thank's
Frank
|
|
|
|
|
Hai Everybody,
I want to create an application in which i have to have a single CPU but the results has to be displayed in multiple monitors which are all connected to it. Can any one help me by specifying the requirements.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: Can any one help me by specifying the requirements.
Software, hardware, human resourses?
|
|
|
|
|
Software and hardware resources (For hardware i have posted the same in the hardware discussion board).
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Well on the software side you just need an OS that supports multiple monitors. Which is pretty much all OS's these days. From .Net you can use the 'System.Windows.Forms.Screen' class to deal with what monitors are available and where they are.
For the hardware you just need as many GFX ports as you have monitors. Unless your doing heavy graphics stuff your bog standard graphics card should handle it all. A multicore CPU would probably be handy just to make sure all the windows stay nice and responsive but not a requirement.
|
|
|
|
|
Hello all
at my job i made a Stocks program.
in this stock program there is Reports that show some info from the database.
the report viewer works on windows xp , but on windows 98 im getting this error
An error occurred during local report processing
"The definition of the report 'Main Report' is invalid.
server has encontered a confiuration error.see the report server log files for more information"
Please Help me .
|
|
|
|
|
What is this built with? VC++? C#? VB? What is Main Report? A component you built? A third party control?
michael@cohen wrote: "The definition of the report 'Main Report' is invalid.
server has encontered a confiuration error.see the report server log files for more information"
Well, what do the log files say?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
the code is c# ,i dont know what is main report...
and i dont know where can i find the log file...
|
|
|
|
|
Hi,
Im writing an auto update app in vs2005. I would like
to call an update procedure from a web service automatically
at say 19:00 everyday.
What would be the best way of achieving this?
I dont need any code or anything just wanna know the best easiest or safest way
of doing this and then start googling :P
Thanks
|
|
|
|
|
Hi
I have problem here
i have a column DateTime in database
i want to insert time only in this column
but after i add the time i find the data in table is date with time
this conflict the data when i rowfilter the dataview by this column
how can i solve it
"comment: this is the code of DataView "
DV_Deatils.RowFilter = "Room_No='" + combo_Rooms.SelectedValue + "' and ExamDate='" + dtp_examdate.Value.ToString("D") + "'"+
" and ExamTime>='" + txt_time.Text + "' and ExamTimeTo<='"+txt_timeto.Text+"'";
MD_NADA
|
|
|
|
|
md_nada wrote: but after i add the time i find the data in table is date with time
This is because the fact that SQL doesnt has a datatype called time but DateTime.
What you can do is, in the design mode of your database table set the format as short time( or which ever suitable to you)
|
|
|
|
|
Manas Bhardwaj wrote: What you can do is, in the design mode of your database table set the format as short time( or which ever suitable to you)
The database isn't interested in the format of the DateTime. Setting some format only alters the way it is displayed. It will still store something for the date portion.
This means you still have to consider what date you are going to give it so that queries work as expected.
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
|
|
|
|
|
Assuming this is MS Sql Server, there is no Time datatype, only DateTime. You just need to ignore the Date portion of the DateTime field you're interested in.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Simply ignore the date part when you retrieve the value from the database.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Hi,
first of all, I hope you're validating the values of dtp_examdate, txt_time and txt_timeto before filtering your DataView.
There are few things you could try, and I'll be honest, I'm not sure if any of them is good.
1. You can place a hardcoded date value in the database, for example '2007-01-01' will always be the date part of your datetime field. Probably not a good idea, you'd still need to handle insert/update properly (by a trigger perhaps), and parse the time value when selected from the DB. I'd say too much overhead.
2. Perhaps better than 1: store the time value in separate tinyint fields, Hour, Minute, Second. I believe this way you can filter the data easily, you only need to combine the values to display the time properly.
Hope that helps
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images. All of this is very weird.
In the end, war is not about who's right, it's about who's left.
|
|
|
|
|
Hi!
In my program i receive a data through TCP socket and i put them into a dataset. How can i insert these values into a .sdf (pocket pc/compact framework) database. Is there a method other than using an INSERT command for every dataset row? Because using INSERT is too slow.
Thank you!
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
I've found it usually isn't the INSERT that is slow it is the database roundtrips that are slow. If the framework supports it then you should batch a number of INSERTs into one Command and send them together.
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
|
|
|
|
|
But how can i do this?
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
SQL Server CE is in-process so the round-trip problem doesn't apply. The parser only accepts one statement per batch. The parser is appallingly slow and the query execution engine isn't much better. You actually get best performance by simply opening the tables directly (specify the table name for SqlCeCommand.CommandText and set SqlCeCommand.CommandType to CommandType.TableDirect ) and not using SQL at all (ironically).
In CF 1.0 you could read tables directly but not update them - you had to use INSERT queries and Prepare the command object to avoid the query compiler overhead. CF 2.0 has a SqlCeResultSet class which is back to the bad good old days of ADO Recordset - you can scroll back and forth with a client-side cursor, seek to specific values, update or delete existing rows and insert new rows.
|
|
|
|
|
Mike Dimmick wrote: SQL Server CE is in-process so the round-trip problem doesn't apply. The parser only accepts one statement per batch.
Ah, okay - I've never used it.
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
|
|
|
|