User Profile
Collapse
-
When user picks date in DateTimePicker, it's Value property is set to DateTime.Now. This means that, aside from 'date' value, you have also picked 'time' value. Also, when you're using DateTimePicker. Value to construct sql query in a way shown in your code, what you really get is DateTimePicker. Value.ToString( ), which depends on property Format of DateTimePicker and CultureInfo set for your system/thread/application. Since date and time are displayed... -
I think it is probable that your comunication with the server causes this. Does the methods you use (Send/Receive) are blocking or unblocking? If it's the former, then the situation you described can happen (I mean, the GUI will freeze until the response is received). To avoid it, you can e.g. use BackroundWorker .Leave a comment:
-
To do what you want, you basicly have to handle events of your form and controls. For example, to enable/disable some controls when combobox value is changed, you have to handle SelectedIndexCh anged event of your combobox (you just need to double-click it in your design window and the method will be created for you :)) You do enabling/disabling here.
Also, you may want to override OnPaint method of your form to draw your shapes (and...Leave a comment:
-
I don't know if it's the most efficient way, but something like this should work:
...Code:CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US"); DateTime zeroPoint; long seconds = numberOfSecondsReturnedFromTheDevice; DateTime myDate; try { zeroPoint = DateTime.Parse("1/01/1970 00:00:00", culture); myDate = zeroPoint.Add(new System.TimeSpan(seconds*1000)); //timespan inLeave a comment:
-
Are you sure it is not some sort of hardware problem? What kind of connection is it? Do you use RS-485 and some sort of converter or something else?
Do you know what exactly and when exactly is sent/received by your program and at what time? There is virtual serial port emulation software that can intercept your data, so you can see what's going on. (I used it, but it was someone else who installed it so I dont realy remember what was...Leave a comment:
-
There are three different timer classec in c#, if you use them in a wrong way it can really hurt. This articles explain the differences:
http://msdn.microsoft.com/en-us/magazine/cc164015.aspx
http://intellitechture.com/System-Wi...-Timers-Timer/
Since your timer has an event called "Tick", I guess its System.Windows. Forms.Timer, which is supposed to be used only...Leave a comment:
-
in CellContentClic k you have to ensure that the index you're trying to process:
- is non-negative, meaning isn't -1 (index of headers)
- less than the size of collection, meaning that it isn't the index of new row or index isn't greater than the number of rows or columns you actually haveLeave a comment:
-
I often make this error myself, so I know the error message by heart :)
To check if a string contains something (I didn't check if it works, though, but it should):
And when I want to know something, I don't use tutorials or books, I just ask Google a question :) For example I didn't know the exact syntax that...Code:var q1 = from d in mdc.data where d.surName.Contains("Smith") select d;Leave a comment:
-
This exception means that: "value is not a number in a valid format."
You have to check what exactly is in your txtConversion1. Text at the moment of convertsion. Set a breakpoint there and find out. The string you're trying to convert may be invalid, or empty.Leave a comment:
-
Method Form.Show(owner ) sets "A Form that represents the form that is the owner of this form." (according to MSDN)
If you want for your usercontrol to "own" the form, try setting Form.Parent property.
Or, in your Form3 class, you can add your own property that you will set when creating the form:
...Code:public partial class Form3 : Form { public Control OwnerControl{get;set;} publicLeave a comment:
-
Are you ABSOLUTELY SURE that you didn't forget '=' character somwhere here?
If I do this:
I get exactly the error message that you're gettingCode:var q1 = from d in mdc.data where d.surName [B]=[/B] SurName && d.firstName == FirstName select d;
Leave a comment:
-
I think you can do:
Code:var q1 = from d in mdc.data where d.surName == SurName && d.firstName == FirstName select d;
Leave a comment:
-
Try doing this
after reloading your data sourceCode:CurrencyManager cm = (CurrencyManager)this.dataGridView1.BindingContext[myBindedDataSource]; if (cm != null) { cm.Refresh(); }Leave a comment:
-
I assume it works for every row except 0?
When I worked with DataGridViews I noticed that sometimes there are some strange problems when you use SelectedRows property.
Also DGW sort of creates cells "on the fly", I don't really understand the mechanism behind it, but sometimes some clells aren't accessible. Although, I never experienced this problem in CellContentClic k event.
If you're using CellContentClic k...Leave a comment:
-
-
-
There was actually another person who asked a similar question here just yesterday :) To not repeat my answer, this is the link to that thread: http://bytes.com/topic/c-sharp/answe...-c#post3686542
Allso, all the info that you'll ned to know about DataGridViews is here http://msdn.microsoft.com/en-us/libr...agridview.aspx
And, well, I started using C# not...Leave a comment:
-
You can select current cell for example by clicking it - by subscribing to one of this 4 events (pick the one that suits you best):
- CellClicked http://msdn.microsoft.com/en-us/libr...cellclick.aspx
- CellContentClic k http://msdn.microsoft.com/en-us/libr...tentclick.aspx
- CellContentDoub leClicked http://msdn.microsoft.com/en-us/library/system....Leave a comment:
-
Maybe, only on shutdown, try sending the mail without using other threads? I wonder if the "system shutdown sequence" will wait for the main thread of the service to complete before the service terminates?Leave a comment:
-
Are you sure you can't use Access Runtime? It's free, rather small (well, comparing to the wole MS Office package, it is, 32-bit version of Access Runtime 2010 is 175.5 MB) and not that hard to install.
I don't know if there is one single dll that will allow you to run your program, I haven't heard of any, access is a rather complex thing, some people even say that it's pure magic (as in I-don't-know-how-it-happend-it-just-did magi...Leave a comment:
No activity results to display
Show More
Leave a comment: