shlvy Posted October 30, 2003 Posted October 30, 2003 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 Quote
Moderators Robby Posted October 30, 2003 Moderators Posted October 30, 2003 It sounds like CheckUser() has some arguments that you are not passing in your call to it. Is this a function you created? Quote Visit...Bassic Software
shlvy Posted October 30, 2003 Author Posted October 30, 2003 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 Quote
Moderators Robby Posted October 30, 2003 Moderators Posted October 30, 2003 (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 October 30, 2003 by Robby Quote Visit...Bassic Software
Administrators PlausiblyDamp Posted October 30, 2003 Administrators Posted October 30, 2003 As Robby said - the function is expecting 2 parameters obj and e - you are providing neither. Then again the Sub doesn't seem to need them - just change the declaration to sub CheckUser() Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
shlvy Posted October 30, 2003 Author Posted October 30, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.