|
Luc,
Thanks for your reply. That is exactly what I needed to do. Its the second time you have replied to my help and I sincerely thank you!
Hogan
|
|
|
|
|
You're welcome.
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
|
|
|
|
|
Ok, listen here. I have an application which code I cannot access. It has an Inactivity timer which is running. If I dont touch the pc for more than a certain ammount of time a message will show and log me out. Id like to know how to stop this by writing some code to make it look as though someone is active in windows when really they are not.
The only thing i can think of is creating a timer and sending some sort of message to windows to make it look as though we are active.
Thanks in Advance.
www.codewash.com
|
|
|
|
|
It depends exactly how it defines activity. Theres plenty of apps around if you search for something like "mouse mover".
|
|
|
|
|
|
Thanks Dinobot_Slag, we are on the right track. I need to figure out now how to send like a wm message or somthing so that the hooks being used by the application will see it and believe we are active.
www.codewash.com
|
|
|
|
|
Hi I'm looking to my queries to an Access database in C# that is password protected and I am having difficulties. The password is 13 characters long and contains capital, lowercase, symbols (#$%^) and numbers. My connection string looks like this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\file.mdb;User ID=admin;Password=P@$$w0rD";
When I call:
OleDbConnection myConnection = new OleDbConnection(connectionString);<br />
myConnection.Open();
The program crashes with an unhandled exception of type 'System.Data.OleDb.OleDbException in system.data.dll.
I did some research and it says that C# handles special characters in a way that isn't compatible with some access databases. I'm not sure if $%^ are special characters, or if that means just unicode.
Does anyone know where I'm slipping up or how to fix this? Any advice would be appreciated.
|
|
|
|
|
Ken Mazaika wrote: The program crashes with an unhandled exception of type 'System.Data.OleDb.OleDbException in system.data.dll.
And what did the exception message say? That is quite important becuase there are many reasons it might throw an exception of that type.
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."
My website
|
|
|
|
|
The message box said "Microsoft Development Environment" in the titlebar, the words "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll" and Break, Continue, Ignore (disabled), and Help buttons.
The debugger highlights the line immediately following the Open(), which happens to be return true;
thanks,
-Ken
|
|
|
|
|
Just to eliminate an obvious error: I am assuming you are using the @ symbol at the beginning of your connection string assignment.
string connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\file.mdb;User ID=admin; Password=P@$$w0rD";
If not, then you should be using a double backslash when listing your Source:
Source=C:\\file.mdb;
|
|
|
|
|
Sorry, I did use a double backslash I just changed the code to a different path to be simpler. Thanks though,
-Ken
|
|
|
|
|
I figured out the answer thanks to another user's post on a particular article here.
To access a password protected database you can add another part to the connection string. I added this to the end of it and it works like a charm.
jet OLEDB:Database Password=mypassword;
I'm not sure why the password needs to be listed twice, but it seems to work. I also had issues doing this with Toolbox>Data>OleDbConnection wizard that matched my results pretty well. Hardcoding the connection string with that added fixes it though.
-Ken
|
|
|
|
|
How do I change the Windows Hours in run time?
I want to click on a button and add hours at the Windows-time.
Help-me please.
Cheers.
|
|
|
|
|
Hello,
The 'kernel32.dll' funktion 'SetLocalTime' will help you.
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct SystemTime
{
public short sYear;
public short sMonth;
public short sDayOfWeek;
public short sDay;
public short sHour;
public short sMinute;
public short sSecond;
public short sMilliSeconds;
}
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool SetLocalTime(ref SystemTime time);
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thread.Sleep(3600000) is much simpler.
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
|
|
|
|
|
Yes, and also no API needed!
All the best,
Martin
|
|
|
|
|
Hello again,
You asked, if I can contact you per email.
The answere is: No!
Please, ask questions or make statements here on the forum, so everybody can benefit!
All the best,
Martin
|
|
|
|
|
Hi am new to web custom control.How to create a Web custom control and how to access it in the application.Can anyone help me out with it...Thanks in advance...
--Siva--
If there is a way, i'l find one
If there is none,i'l make one
|
|
|
|
|
Hello,
I am working on form application with 1152*864 resolution.
If i changes my screen resolution and restart the application then some controls(textbox, picture box etc) on the form and not getting adjusted according to new screeen resolution.
I have enable anchor in all direction for all control.
What should i do so that my application works smoothly for all screen resolution.
Thanks.
gajesh
|
|
|
|
|
gajesh wrote: I have enable anchor in all direction for all control.
I doubt that is a good idea.
You might want to spend some time thinking about how best to anchor your controls.
Anchoring a control that sits at the top left of the form in all directions will just make it expand when the screen size increases - You probably don't want that to expand in all directions. You probably only want it to stay in position relative to the top left of the form.
You might decide that a text box is something that would be more useful if it stretched width-wise. In that case anchor it to the left and right. And controls to the right of the text box should be anchored to the right, but not the left.
In short, think about what anchoring actually does. There is no one-size-fits-all to apply to all controls. You actually have to think about how you want the form laid out.
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."
My website
|
|
|
|
|
Colin Angus Mackay wrote: You might want to spend some time thinking
That's not how it's done. You just drag n drop and click a bunch-o-stuff until "it works"
If it works, do it.
If it works, do it it works.
seems to probably
If it ^ work s, do it it ^ works
(and might work again )
Gogito egro sum (although, admittedly, that is an assumption )
|
|
|
|
|
Colin Angus Mackay wrote: In short, think about what anchoring actually does. There is no one-size-fits-all to apply to all controls. You actually have to think about how you want the form laid out.
and once you go beyond a very basic layout and want something like a proportional split between two elements instead of having one fixed and the other doing the resizing you have to start writing some manual code in the onResize event anyway.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Design the controls runtime, according to its left,right,top,bottom and with respect to different controls already present their according to your need.
Imran
|
|
|
|
|
I read in configs from XML and one element is converted to an ENUM
enum SOURCETYPE
{
XML,
SQL
}<pre> //all error checking removed (for a laugh)
//other bits removed but you'll get the idea
SOURCETYPE _myType;
string myString = myXmlNode.Attributes.GetNamedItem("type").Value;
switch (myString.TrimEnd().ToUpper())
{
case "SQL":
_myType = SOURCETYPE.SQL;
break;
case "XML":
_myType = SOURCETYPE.XML;
break;
}
Is there a better / quicker / more CSharpish way of doing this? If I had loads of types it would be a big case statement to change "TYPE" to SOURCETYPE.TYPE.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
|
|
|
|
|
hi
SOURCETYPE _myType = Enum.Parse(typeof(SOURCETYPE), myString);
regards
|
|
|
|