|
Use ManagementBaseObject class. This can help you to get the owner details.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hello All,
I use VB .Net forms and i have a requirement as follows.
In a form, a click of a button should be automated through windows schduler and one more button would be placed in the form for other activities.
Basically, in a single exe we would be performing two activiites, one as a daily routine through windows scheduler (one button) and other is a manual process (Button that would be visible to the end users)
Hope i am not confusing
Let me know how to take this forward.
Thanks.
|
|
|
|
|
I doubt windows scheduler can click any button at all. Why not write it as a console app and use command line parameters?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
The Scheduler cannot click buttons. Your code has to be rewritten to accept command line parameters, which the Schedular CAN use, to tell your app what to do.
Also, don't put actual work methods in the button Click handlers. Move that code to other methods that can be called from your command line handler or from the Click handlers or from just about anywhere else you're going to need to cal that code from.
|
|
|
|
|
Ditto to Dave. When the app is starting up, check the command line args that are being sent in. Parse the args and then run the appropriate methods.
This is easy to test. Go to the project --> debug tab. Enter your args in the command line args textbox.
Cheers.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Imports System.Data.OleDb
Public Class Form1
Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Downloads\user.mdb")
Dim cmd As OleDb.OleDbCommand
Private Sub LogOn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOn.Click
Dim sql As String
sql = "SELECT Username,Password FROM user WHERE Username='" & TextBox1.Text & "' AND Password='" & TextBox2.Text & "'"
cmd = New OleDb.OleDbCommand(sql, con)
con.Open()
Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader
Try
Catch ex As InvalidOperationException
MsgBox(ex.Message)
End Try
Try
If dr.Read = False Then
MessageBox.Show("Logon failed...")
Else
MessageBox.Show("Logon successfully...")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()
End Sub
End Class
this is my code
i get an error msg stating OleDb Exception was unhandled and syntax error in FROM clause
can sombody fix this issue??
thanks
|
|
|
|
|
vijay2482 wrote: sql = "SELECT Username,Password FROM user WHERE Username='" & TextBox1.Text & "' AND Password='" & TextBox2.Text & "'"
vijay2482 wrote: syntax error in FROM clause
Use a stored procedure
I are troll
|
|
|
|
|
i have an MS Access Database table,which i have connected with the VB.net proj
Troubleshooting Exceptions: System.Data.OleDb.OleDbException
An OleDbException exception is generated when a warning or error is returned by an OLE DB data source.
Associated Tips
Verify that you are connecting with valid credentials.
Make sure that the credentials you are supplying are valid. For more information, see OleDbErrorCollection.
Verify that the server name is correct and that the server is running.
Make sure that you are using the correct server name, and that the server can be reached. For more information, see OleDbErrorCollection.
Remarks
This exception is thrown whenever the .NET Framework Data Provider for OLE DB encounters an error generated by the server.
If the severity of the error is too great, the server may close the OleDbConnection. However, the user can reopen the connection and continue.
this is the online help.i am not able to find whats wrong with my code
im not aware of stored procedures...
can u help me out in this coding?
|
|
|
|
|
That's a warning from the integrated security, probably an error in the connectionString. Try this one:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Downloads\user.mdb;User Id=admin;Password=;
vijay2482 wrote: Verify that you are connecting with valid credentials.
It is referring to the credentials in your connection, the one used to connect to the database. You can't perform a "SELECT FROM USER" until you have a database-connection. And you'll need a user-name and a password to do that
The supplied connectionstring feats. the default username and password for MS-Access. From there-on you can implement your own security-system.
I are troll
|
|
|
|
|
I expect your select statement is incorrect, probably with all the embedded quotes. Use either a stored procedure or a parameterised query, or if you must leave yourself open to sql injection attack then print the select statement out and see where its wrong.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
The error says your SQL statement has a problem in the FROM clause. Does your database have a table called "Users"? BTW: That's NOT referrring to the name of the database file.
|
|
|
|
|
yes i do have a database file named as "user"
i deleted the existing data source in vb.net and recreated it
even then the same error is been displayed
kindly give a solution for this problem
thanks in advance
|
|
|
|
|
Inside that file, do you have any table called user?
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
yes i do have a table called user with Username and Password as the fields and 3 entries in it
|
|
|
|
|
Well the error message says you don't. Try enclosing the table name in square brackets in your SQL statement.
SELECT Username, Password FROM [User] WHERE ...
BTW: Your WHERE clause is a VERY bad way of looking up what was entered on the login page. Use parameterized queries instead.
|
|
|
|
|
thanks a lot, its working now
|
|
|
|
|
How can i manage to move a label in a vb6.0? can i ask for the source code...Please i need help
|
|
|
|
|
Label1.Move Left,Top,Width,Height
Label1.Move 500, 1500, 1000, 200
better to try in .net. VB is old lang.
|
|
|
|
|
Friend,
This is the sample code for moving label. you need to add a label from tool box and paste this code into form load event.
Label1.Move 1000, 1500, 5000, 5000
|
|
|
|
|
hii all..i want the user to enter hexedecimal valuein the text box, so i need to convert it..but i dont know how..anyone can help me plss
this is my email: hafizul_10422@yahoo.com
|
|
|
|
|
|
how to validate the hexadecimal value??
thanks for ur help!!
|
|
|
|
|
Hi,
You can use the Parse or TryParse methods of the number types to do the conversion. This fragment in c# should get you started.
String userInput = "ab7f";
Int64 value = Int64.Parse(userInput, System.Globalization.NumberStyles.HexNumber);
Alan N
|
|
|
|
|
What do want to convert it to?
The assumption is that it's to integer but it could be to character or binary or unicode.
E.g. 4C hex goes to:
integer 76
binary 01001100
ASCII L
EBCDIC <<br mode="hold" />
You really need to be specific when asking questions.
|
|
|
|
|
I’m stuck on how to enter a HEX number into a text box
|
|
|
|