Hello, Still a bit new to ASP.NET/VB.NET and I am having a problem with one of my Sub procedures getting a boolean value from a function. Here is the calling sub:
sub dgData_Update(Sender as Object, e as DataGridCommandEventArgs)
if UpdateDataStore then
FillDataGrid(-1)
end if
end sub
Here is the function it is calling:
function UpdateDataStore(e as DataGridCommandEventArgs) as boolean
dim i, j as integer
dim params(7) as string
dim strText as string
dim blnGo as boolean = true
j = 0
for i = 1 to e.Item.Cells.Count -3
strText = Ctype(e.Item.Cells(i).Controls(0), TextBox).Text
if strText <> "" then
params(j) = strText
j = j + 1
else
blnGo = false
lblMessage.Text = lblMessage.Text & "You forgot to enter a value
"
end if
next
if not blnGo then
return false
exit function
end if
dim strSQL as string = "UPDATE tblUsers SET " & _
"First Name = '" & params(0) & "'," & _
"Last Name = '" & params(1) & "'," & _
"Address = '" & params(2) & "'," & _
"City = '" & params(3) & "'," & _
"State = '" & params(4) & "'," & _
"Zip code = '" & params(5) & "'," & _
"Phone number = '" & params(6) & "'" & _
" WHERE UserID = " & Ctype(e.Item.Cells(0).Controls(1), Label).Text
ExecuteStatement(strSQL)
return blnGo
end function
The error I am getting during the compile process is: Compiler Error Message: BC30455: Argument
not specified for parameter 'e' of 'Public Function UpdateDataStore(e As System.Web.UI.WebControls.DataGridCommandEventArgs) As Boolean'. Source Error: Line 68: Line 69: sub dgData_Update(Sender as Object, e as DataGridCommandEventArgs) Line 70: if UpdateDataStore
then Line 71: FillDataGrid(-1) Line 72: end if Any help would be much appreciated! Thanks, Jason D.
davidj2
Member
10 Points
2 Posts
error BC30455: Argument not specified for parameter 'e' of 'Public Function [name_of_function]
Aug 27, 2004 03:57 AM|LINK
sub dgData_Update(Sender as Object, e as DataGridCommandEventArgs) if UpdateDataStore then FillDataGrid(-1) end if end subHere is the function it is calling:function UpdateDataStore(e as DataGridCommandEventArgs) as boolean dim i, j as integer dim params(7) as string dim strText as string dim blnGo as boolean = true j = 0 for i = 1 to e.Item.Cells.Count -3 strText = Ctype(e.Item.Cells(i).Controls(0), TextBox).Text if strText <> "" then params(j) = strText j = j + 1 else blnGo = false lblMessage.Text = lblMessage.Text & "You forgot to enter a valueThe error I am getting during the compile process is: Compiler Error Message: BC30455: Argument not specified for parameter 'e' of 'Public Function UpdateDataStore(e As System.Web.UI.WebControls.DataGridCommandEventArgs) As Boolean'. Source Error: Line 68: Line 69: sub dgData_Update(Sender as Object, e as DataGridCommandEventArgs) Line 70: if UpdateDataStore then Line 71: FillDataGrid(-1) Line 72: end if Any help would be much appreciated! Thanks, Jason D." end if next if not blnGo then return false exit function end if dim strSQL as string = "UPDATE tblUsers SET " & _ "First Name = '" & params(0) & "'," & _ "Last Name = '" & params(1) & "'," & _ "Address = '" & params(2) & "'," & _ "City = '" & params(3) & "'," & _ "State = '" & params(4) & "'," & _ "Zip code = '" & params(5) & "'," & _ "Phone number = '" & params(6) & "'" & _ " WHERE UserID = " & Ctype(e.Item.Cells(0).Controls(1), Label).Text ExecuteStatement(strSQL) return blnGo end function
Jason D.
SomeNewKid
All-Star
45894 Points
8027 Posts
Re: error BC30455: Argument not specified for parameter 'e' of 'Public Function [name_of_function...
Aug 27, 2004 05:01 AM|LINK
sub dgData_Update(Sender as Object, e as DataGridCommandEventArgs) if UpdateDataStore(e) then
FillDataGrid(-1)
end if
end sub
Does that help?SomeNewKid
All-Star
45894 Points
8027 Posts
Re: error BC30455: Argument not specified for parameter 'e' of 'Public Function [name_of_function...
Aug 27, 2004 05:02 AM|LINK
davidj2
Member
10 Points
2 Posts
Re: error BC30455: Argument not specified for parameter 'e' of 'Public Function [name_of_function...
Aug 27, 2004 07:23 PM|LINK
Jason D.