|
I need to send various ps2 commands to my keyboard as part of my apps functionality.
Example from the PS2 spec:
0xF5 = disable kybd
0XF2 = Read ID
Some commands like the Read ID also require the ability to get the response.
I Googled for awhile so I turn here for some ideas.
Thanks,
JayHart
|
|
|
|
|
PS2 as in Play Station? So your writing PS2 games using C#? Wow... I need to do some Googling! Good luck.
|
|
|
|
|
Nope, not playstation,
the old cruudy keyboard you plug into your PC instead.
Jay
|
|
|
|
|
I had a page fault
I have no experience using a keyboard for anything other than input.
|
|
|
|
|
I don't believe you can send any output beyond the status of the num, scroll, and capslock keys to change the indicator lights. You'll need to read up on the hardware implementation to match what your device is expecting to see with what signals are generated when the states of those keys are altered on the PC.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
|
Oh God...
SERIOUSLY, you need to pick up a book on C# for beginners. The questions you've asked go back to the frist day of any beginning programming class.
|
|
|
|
|
Does sound like a set of questions you'd get near the beginning of a programming course...
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Do I need to find J4amieC?
In case you didn't understand what Jamie said, you should STOP typing messages into forums and spend more time READING.
|
|
|
|
|
|
What am I doing wrong?
SqlConnection conn = new SqlConnection("Data Source=(local)\\SQLEXPRESS;Initial Catalog=opc;Integrated Security=True");
conn.Open();
SqlCommand selCmd = new SqlCommand("SELECT COUNT(*) FROM data WHERE timestamp>@pdate1 AND timestamp<@pdate2", conn);
SqlParameter date1 = new SqlParameter();
date1.ParameterName = @pdate1;
date1.Value = TextBox1.Text;
SqlParameter date2 = new SqlParameter();
date2.ParameterName = @pdate2;
date2.Value = TextBox2.Text;
selCmd.Parameters.Add(date1);
selCmd.Parameters.Add(date2);
int count = (int)selCmd.ExecuteScalar();
Label1.Text = count.ToString();
conn.Close();
I get 2 errors:
Error 1 The name 'pdate1' does not exist in the current context
Error 2 The name 'pdate2' does not exist in the current context
|
|
|
|
|
It should look like this:
date1.ParameterName = "@pdate1";
date2.ParameterName = "@pdate2";
|
|
|
|
|
Yes I found it few minute later...Thanks
But now I get another error.
protected void Button_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=(local)\\SQLEXPRESS;Initial Catalog=opc;Integrated Security=True");
conn.Open();
SqlCommand selCmd = new SqlCommand("SELECT COUNT(*) FROM data WHERE timestamp>@date1 AND timestamp<@date2", conn);
SqlParameter param1 = new SqlParameter();
SqlParameter param2 = new SqlParameter();
param1.ParameterName = "@date1";
param1.Value = TextBox1.Text;
selCmd.Parameters.Add(param1);
param2.ParameterName = "@date2";
param2.Value = TextBox2.Text;
selCmd.Parameters.Add(param2);
int count = (int)selCmd.ExecuteScalar();
Label1.Text = count.ToString();
conn.Close();
}
I get this Sql Exception:
Arithmetic overflow error converting expression to data type datetime.
In line "int count = (int)selCmd.ExecuteScalar();"
I need to count the rows between these two dates...
|
|
|
|
|
It means that when date1 and date2 are replaced with values from the textbox they are not formated correctly and inside the query they can't be compared. Try running the query manually in sql server to see what error you will get. Also, if I remember it correctly, datetime variables need ' in the query
|
|
|
|
|
I tried the below query
SELECT COUNT(*) AS Expr1
FROM data
WHERE (timestamp > 19 / 08 / 2007) AND (timestamp < 23 / 08 / 2007)
manually but got 0
The column is
19/8/2007 10:25:40 am
19/8/2007 10:25:59 am
20/8/2007 6:10:56 am
20/8/2007 6:11:49 am
20/8/2007 6:20:20 am
20/8/2007 6:20:32 am
20/8/2007 6:20:38 am
|
|
|
|
|
It means that you have mistake in your sql query
|
|
|
|
|
Hello all,
I have read all about changing time from regular time (1:00 PM) to military time (13:00) however I cannot find anywhere about how to let a user enter either of these as valid times. I have an internal app where some users want to enter military time and some want to enter regular time. Right now I only allow the entry of regular time. I would also like to allow military time to be entered with the application "breaking".
Can anyone please assist me?
Thanks a bunch!
~Candi
|
|
|
|
|
stormcandi wrote: Can anyone please assist me?
Probably, but your odds increase greatly if you ask a specific question.
|
|
|
|
|
How can I allow the entry of military and regular time in code?
~Candi
|
|
|
|
|
Oh well then maybe this [^]will help
Last modified: 45mins after originally posted -- fixing URL
|
|
|
|
|
Mike, you used the same link as on the previous question.
All the best,
Martin
|
|
|
|
|
Wow thanks for the quality control message I think it's fixed now.
|
|
|
|
|
How are you getting the data from the user? How are you converting it into a date/time? If you are getting text, I would check it against a regex to see what format it is, or you can use TryParse to see if one fails to be coerced into a date/time. The easiest way to get a helpful answer would be to post your current code that is reading in only "regular" time, so we can make suggestions as to how to modify it to accept military time.
Jeff
|
|
|
|
|
Jeff,
Funny thing is I just double-checked my code and it will accept military time with the : but not without it. So I can just do some checking to make sure the : is in the time and then I am done. (I was trying it without the : to see if it worked.)
~Candi
|
|
|
|
|
Hi,
I am a newbie in C# and I was asked to develop a Windows Control Library. I have understood how to generate one and link it into a Windows Application Test Application. I want to make a property that shows up in the Property window and allows the user to have a pulldown to select the property, does anyone have a tutorial or some sample code to how this is done. I cant find anything online.
Any help would be greatly appreciated
Thanks
|
|
|
|