It is easier to give advice and answers when relevant information is stated up front. If this is a Windows app, you are guaranteed to have IE on the machine, why bother with trying to support others browser controls. I'm sure your project has a timeline and budget, does it including trying to develop something to support all possible combinations of technology?
Hi guys. I have the below code but am having problems with compiling the code. I get the following error when compiling the code. I know where the error is but do not know how to fix it. Can somebody please advise?
The error message is as follows:
"Operator '==' cannot be applied to operands of type 'method group' and 'bool'"
privatevoid btnCancel_Click(object sender, EventArgs e)
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=W:\CS Call Info\MobEmail.mdb");
privatevoid btnLogon_Click(object sender, EventArgs e)
//Connection Codestring sql = "SELECT UserName,Password FROM Users WHERE UserName = '"
+ txtboxUserName.Text + "' AND Password = '" + txtboxPassword.Text + "'";
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataReader dr = cmd.ExecuteReader();
//Open the Connection
catch (InvalidOperationException ex)
//Read Databaseif (dr.Read == false) //This is where the error is
MessageBox.Show("Invalid Username And Or Password Supplied", "Logon Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.DialogResult = DialogResult.OK;
catch (Exception ex)
if (conn.State != ConnectionState.Closed)
1. Read is a method so it needs brackets.
2. Your code is open for sql injection attacks. This article will help you to avoid them SQL Injection Attacks and Some Tips on How to Prevent Them[^]
4. You should open connection first in order to invoke ExecuteReader()
3. Use finally block to close connection.
My guess is that you are missing the click. The reason why is that the coordinates sent to the mouse event MUST match the coordinates that the mouse is actually at. If not, windows ignores the event altogether. I would open Spy++ and make sure that all your messages are being sent identically as when you do it manually. I also didn't check your SendMessage syntax/data, so you may have done that wrong as well. If you fix the mouse_event problem and it still doesn't work, let me know and I will check the other. Good luck,
What happens if you just send the SHIFT key (0x10)? I also wonder if, since you are sending a specific shift key, if you have to set bit 24 on the lparam sent with SendMessage. In the past I have also had instances when I had to use PostMessage for an application to receive the keystroke. If I were you I would go through the following progression:
1. Try using SendMessage (up + down) for something simple (like an 'a' 0x41).
2. Try using PostMessage (up + down) for something simple
3. Try using keybd_event (up + down) for something simple
If none of the above messages were received by your target application (and the last win32 error is not from your calls to the methods), then post your results so I can help some more. Otherwise, continue using the message type (Send, Post, or event) that worked from steps 1-3:
4. Modify your messages to send the Shift key (if it doesn't work, try sending the left or right specific shift keys; if you still get nothing, use Spy++ to see EXACTLY what each parameter is being set to, and mimick exactly those params)
After you complete these steps, you should be able to get your code working. Here is a reference for WM_KEYDOWN[^] if you need it. Let me know if this helps,
A large portion of ORM tools use reflection - so obviously if you start obfuscating property names then things will break.
First time I've heard someone ask this so I have no idea how Diamond Binding stacks up (and I have to admit I'm curious). In an ideal world the obfuscator would pick up all string references to types in config and sort it out.
i want to save MsWord document to sql server database as binary type.
i want when user like see document, it extract from database to disk (*.doc), then load into my app and display it's content (with images and tables and ...), but how to do ?
I'm using FreePDF for quite a while now to print directly to pdf. It seems there is a possibility to create a printer and bind a server or process to it to grab the PostScript output of it and do some stuff with it afterwards. A few weeks ago I saw something similiar on the site of my VoIP provider: A fax printer which can fax directly (nothing new but programmed in .NET).
So I'm curious if somebody know how to create the printer and connect with a service to it. Could come in handy sometimes (I think here in the direction of archives or so)