Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi

When i use the event click :

 

sub StartMe(obj as object, e as eventArgs)

CheckUser()

InsertData()

end sub

 

I get Error message :

 

Compiler Error Message: BC30455: Argument not specified for parameter 'e' of 'Public Sub CheckUser(obj As Object, e As System.EventArgs)'.

 

Why?

Thank's

Posted

CheckUser

 

HI

 

Yes i made this sub , she works properly , here the sub :

 

 

sub CheckUser(obj as object, e as eventargs)

 

dim intId as integer = 0

dim Conn1 as new OleDbConnection("Provider=" & "Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\Inetpub\wwwroot\DataSource\R.mdb")

 

dim objCmd1 as OleDbCommand = new OleDbCommand ("spValidateUser", Conn1)

objCmd1.CommandType = CommandType.StoredProcedure

 

dim objParam1 as OleDbParameter

objParam1 = ObjCmd1.Parameters.Add("@UserName", OleDbType.BSTR)

objParam1.Value = tbUserName.Text

 

try

objCmd1.Connection.Open()

intID = CType(objCmd1.ExecuteScalar, Integer)

objCmd1.Connection.Close

Catch ex as OleDbException

lblMessage.Text = ex.Message

end try

 

 

if intID <> 0 then

lblMessage.Text = "Sorry, choose a different userName"

else

lblMessage.Text = "Hello new User"

end if

 

end sub

 

 

Thank's

  • Moderators
Posted (edited)
If it's using the events of StartMe then you need to pass along obj and e, otherwise remove the args from the Sub declaration since it doesn't look like you're using them in CheckUser(). Edited by Robby
Visit...Bassic Software
Posted

No Arguments

 

Hi

First at all thank's.

That's not working , i did what you told, its worked , if the user name already exist it doesn't insert him to the database but it is not show the message "Choose another user name"

What's wrong?

Thank's

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...