|
This is a Cross post... And you have posted it a couple of times.. I advice others not to Encourage cross post... You will never get replies for cross post except that "This is a cross post" message from everyone..
Cheers,
Tash
|
|
|
|
|
Use the ValueChanged event:
this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
//notify form2 the selected date is changed.
}
modified 27-May-14 4:57am.
|
|
|
|
|
Hi again, I have a program that wants to use the database in a remote server. the remote server is located at www.bluehost.com and i cannot connect to it. can anyone help?
|
|
|
|
|
|
Connecting to a remote server database - not sure what exactly you are looking for - if www.bluehost.com does not allow that, then you cannot. Talk to them and check with them if they have any web services you could connect to.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
If they are dumb enough to expose a SQL server directly to the Internet, I'd switch hosting companies, immediately.
|
|
|
|
|
Hi, I have a datagrid that has 4 columns and a label that has the date time along with another label with a transaction number
in my form, the transaction and the datetime is displayed upon the loading of a form. now my question is.
what code do i put in the "save" button so that the value that is written on the datagrid will be placed on the database.
the database by the way has 6 columns... the 4 columns on the datagrid and the datetime with the transaction number.
what do i code in the save button so that the value from the datagrid be placed on the database and for each and every row it includes the transaction number and the datetime..?
thank you for your kind reply
|
|
|
|
|
I think you need to do some very basic research. Entering data into a database is a very common task that is covered in numerous resources, as is using a datagrid.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
In your case if you set the data source of the datagrid to be a select query with the 4 fields needed by the datagrid selected, you will have to do some work to make it write back to the database table with the modified values together with the values from the two labels to all 6 fields. The "lazy" binding will not work automatically for you.
There are easy solutions to this problem, though. The binding of datagrid to a table (so that you can update the table) works well if you have all the fields needed for the table to be updated selected in the datagrid. You always have the freedom to use in-memory table to achieve this. Create a DataTable with the four fields that are needed for the datagrid and bind it to the datagrid. (If you need to modify existing records you need to populate this DataTable first.) In the "Save" button handler, use code to update the real table by the data in the DataTable AND the values in the two labels.
I am sorry I can't offer you a code sample for this but I assure you this works. I have done this in my projects, and it is not that complicated.
Good luck and happy programming!
|
|
|
|
|
I'm currently dabbling into digital signage and I'm having troubles with a monitor turning off on me. My question is this : is there a way in C# code that I can tell if a monitor is currently on or off? I'm writing an alert system for me since I cannot correct the monitor's issue at this time.
I've tried looking into system.manager, system.environment, and systeminformation... but was unable to find anything which was able to tell me the monitor's current state.
Specs:
Monitor : Samsung TV
PC: Windows XP PRO 32-bit
|
|
|
|
|
CP has every answer (well, almost). Try here[^].
It does not give the state, but you can play around with the code to see if it helps you.
It uses some Com Interop though.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
modified on Tuesday, January 12, 2010 10:08 PM
|
|
|
|
|
So you want to write an application that tells you when your monitor is off?
What's wrong with just looking at it?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
In Visual Studio 2008 when writing a console application for C# in Debug you were able to click 'start without debugging' to view the results of your program then 'press any key to continue'.
Visual Studio 2010 (beta 2) does not offer that option. How do you overcome this?
|
|
|
|
|
Well, if you're concerned that your console window will close too quickly by running it with debugging (i.e. without prompting 'press any key to continue'). You can simply add a call to Console.Readline(); at the end of your Main function. This will keep your console window open until you press a key.
for example:
static void Main(string[] args)
{
Console.Write("press any key to continue");
Console.ReadLine();
}
Hope that Helps!
|
|
|
|
|
Thank you Elegantly simple.
|
|
|
|
|
I think you mean ReadKey() - yes?
|
|
|
|
|
Either one will work. The point is to have the application wait for input before continuing.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have a single-form application which I would like to call this.Close() when it ceases to be the active window of the OS. How do I do this?
|
|
|
|
|
Use the form's Deactivate event possibly
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Add a handler for the Form.Deactivate event. Call Close() in the body of the event handler.
|
|
|
|
|
|
Do you want to close the app, or hide the window?
Either way, handle the LostFocus event for the form, and do what you want there. Calling Close() in that handler will close the application.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
hi all,
i just want create an email account through MAPI or whatever in exchange server . how it is possible?
|
|
|
|
|
I have made a custom date control using button and text box. Every thing works fine. What i need to know is when the control is placed on a form of smaller size and we click on the button in runtime the control goes behind. but in case of windows datepicker in such situtation the control comes ahead of form. How can we achieve this.
|
|
|
|
|
I do not know entierly sure what you mean. Maybe a screenshot would help. I am only guesing.
Such as ComboBox and DateTimePicker. Items shoud be painted on Primary (Non-Client area or Desktop) Display. If you use normaly GDI and draw on client size, and the form is not big enough, then popup wouldn't be painted entirely or a other controls could come on top of other
|
|
|
|