problem on getting oledbcommand worked

J

Jak

I think I have set all the required parameters of the oledbcommand already,
but the procedure still refuse to proceed, it sayes that there must be one
or more parameters not set.

The following is the snippet of my codes:

'-----------------Interface----------------
Public Interface IDatabase
......
ReadOnly Property cnDatabase() As Data.IDbConnection

End Interface

'------------------class login-----------------------
Dim clsDatabase As IDatabase

Private Function Validate(ByVal User As String, ByVal Password As
String) As Boolean
Dim cmd As New OleDb.OleDbCommand()
Dim rs As Int16

cmd.Connection = clsDatabase.cnDatabase
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select count(*) from TLOGIN Where LoginID='" +
User + "' AND Passowrd='" + Password + "';"
' cmd.CommandTimeout = 30

rs = CInt(cmd.ExecuteScalar().ToString)
MsgBox(rs.ToString)

End Function

Best regards,

Jack Zhong
 
A

Armin Zingler

Jak said:
cmd.CommandText = "Select count(*) from TLOGIN Where
LoginID='" + User + "' AND Passowrd='" + Password + "';"

"Password", not "Passowrd"



Armin
 
C

Cor Ligthert [MVP]

Hi Armin,

I am glad to see you back again, whatever you think about OT post.

:)

Cor
 
J

Jak

Oh, I did not find this typing mistake in the code. ^_^ . Thank you very
much.

Best regards,

Jack Zhong
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top