First and foremost, you do NOT use string concatentation to built a query like that. Why? Just Google for "SQL Injection attack" and you'll find out. A big problem with what you've done is what happens if the user types a ' character in their password?? I guarantee that it'll break your code and give you the error that you're talking about.
Then you can Google for "C# SQL Parameterized queries" to find out how to do it correcly. This also has the benefit of making your code easier to debug and maintain.
Next, why are you calling .ToString() on a string?? The Text property always returns a string, so there's no need to call .ToString() on it!
And finally, with an UPDATE statement as yours, you would normally use ExecuteScalar, no ExecuteReader, to launch it.
Try reading the documentation on the Win32_Process class, Create method.Create method[^] for the return values.
If you're trying to run a process remotely that puts up a user interface, like Notepad for example, for the logged in user to see, you can't. It's a HUGE security risk, so WMI won't let you do it.
You CAN however run an executable that does NOT show any user interface, like a Console application.
You can launch the .EXE with the file being on your machine but ONLY if the .EXE file resides in a network share ono your machine. If you don't understand Windows Networking, just copy the .EXE file to the target machine and launch it from there. It's much simpler to do.
I have a text file containing the following content:
the first column specifies the x coordinate of a point and second column specifies the y coordinate.i need to read this file and find slope between all points. like first i find slope between (0,12) and (1,15) and then between (0,15) and (2,6) and so on.i am basically building a wpf application.can anyone help?
i tried to put x and y coordinates in two different arrays but don't understand how to write a code that calculates the slope between points and displays them in a textbox.
i have written the following code snippet:
I want to create a presentation controller or a power point viewer using C#.
I have completed this using microsoft office 2007, but I want to make it not compatible with
microsoft office(because it's licensed).
If there is no MS-office is installed, program should work. And there shouldn't be any licensed
compatibility with the app. And my budget is low to purchase a library.
Do you have any idea?
Please share your opinions.
modified 11-Mar-13 1:58am.
Last Visit: 31-Dec-99 18:00 Last Update: 5-Jul-22 9:57