|
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
How can I reach database relation diagram of sql by using smo? I want to learn parent key table of any column if that column is foreign key.
Forexample, in northwind database, in products table, there is categoryid column. This column is related to id in Category table. I want to find this.
Best Regards
THANKS
|
|
|
|
|
Hi friends,
How can I use Windows keyboard api to press some keyboar keys without using keyboard? I want to press some of keyboard keys by clicking button?
If you give sample code or link, I will be very glad?
Best Regard
Thanks
modified on Monday, August 25, 2008 9:26 AM
|
|
|
|
|
|
|
Check out the Win32 SendInput()[^] function. I wrote an article[^] that demos how to use it for spoofing mouse clicks--keyboard input would be similar.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
|
Hello everyone,
From ServiceController class, we can easily get the names of all the services on the current system. My question is how to get the physical absolute path of the executable file for the service? I found quite a while in MSDN, but failed.
thanks in advance,
George
|
|
|
|
|
The Win32_Process Management class (WMI) contains the absolute path of the executable. If you know the process ID, you can query that class to retrieve the absolute path (referred to as the "ExecutablePath").
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John,
I have the ServiceController object instance related to the service, do you know how to get the process ID from the ServiceController object instance?
regards,
George
|
|
|
|
|
Not offhand. Have you tried google?
It looks like the ProcessID is the same as the Handle, so you could use the Handle property in the Win32_Process class.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi John,
Do you mean the PathName other than the ExecutablePath? I have tried and all the ExecutablePath of all services are null, but PathName contains the full path, PathName contains parameter as well.
regards,
George
|
|
|
|
|
It's "ExecutablePath". This is not part of the ServiceController object, it's something else completely. Google "WMI", or search on Codeproject - there are articles.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Did you read my first response at all? I'm talking about the Win32_Process class.
I suppose you can use the Win32_Service class if you want to.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John,
My mistake before. Now I have found it.
regards,
George
|
|
|
|
|
Helllo,
Can somebody know how to add a tooltip in the controlbox of a Form while it was contained in a Parent MDI
best regards,
dghdfghdfghdfghdgh
|
|
|
|
|
My date format in MS SQL is DD/MM/YYYY hh:mm:ss and it seems the calender in VS 2008 has the date format MM/DD/YYYY
So every time I try query information from my web app(using the criteria of specific periods of time using the calender object) I get bad information if any...
Any advice on how to get the two dates working correctly together...
Also, what should the standard date format be if there is one?
Thanks
|
|
|
|
|
you can do this
DateTime dtTime;
dtTime.ToString("MM/dd/yyyy");
it will change "25/08/2008" to "08/25/2008"
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
That changes it per request though won't it.
I have a table of 80 000 rows. Is that not going to make my requests slower doing it at that level? Is there not a way to change it on how the calender format requests the date?
|
|
|
|
|
If the design of your table is correct, you should have stored this data in a DateTime type field.
span98 wrote: DD/MM/YYYY hh:mm:ss
This is only a display format - you can choose to display the date in any format that you want.
When you open an SQL table interactively though, from within Management Studio for instance, you will see the date being displayed according to the locale settings of your system.
HTH
Btw, cross-posting is generally considered rude
|
|
|
|
|
Ye I have stored it as DateTime.... My PC language is set to UK English and my SQL default is set to British english so that is why I see it as the format DD/MM/YYYY hh:mm:ss
So why does Microsoft Visual Studio not integrate with that? It is reading it as MM/DD/YYYY.
That is the problem I am stuck with
|
|
|
|
|
How are you displaying the date within VS?
|
|
|
|
|
I have two calender objects. I select a date from each...
The first to supply the date FROM and the second to supply the date TO
FROM = @start
TO = @end
|
|
|
|
|
span98 wrote: what should the standard date format be if there is one?
Fwiw, mm/dd/yy (or mm/dd/yyyy) is the "standard" (or at least common) American representation, based on how we read the dates, while dd-mm-yy or dd-mm-yyyy I believe is the common European representation. Mixing up slashes and dashes can be really confusing. dd/mm/yy should never be used anywhere, imo, for this very reason.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|