Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

"If UpdateDataStore then" Is this right syntax?

  Asked By: Lucas    Date: Jun 17    Category: Asp.net    Views: 928
  


Compiler Error Message: BC30455: Argument not specified for
parameter 'e' of 'Public Function UpdateDataStore(e As
System.Web.UI.WebControls.DataGridCommandEventArgs) As Boolean'.

I got this code from Sams teach yourself asp in 21 days page p366 but
it doesnt seem to work.
Here is the subroutine:

Sub MyDataGrid_Update(Sender as object, e as DataGridCommandEventArgs)

If UpdateDataStore then
FillDataGrid(-1)
End if
MyDataGrid.DataBind()
End Sub

SHouldn't it be if updatedatastore is equal to something? Its a
boolean.

Here is the subroutine it calls:

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<p>"
end if
next
if not Blngo then
return false
exit function
end if
dim strSQL as string
strSQL="Update chasers set Name='" & params(0)
& "',Emailaddress='" & params(1)& "',Message='" & params(2)
& "',Frequency='" & params(3)& "',Times='" & params(4)
& "'Start_date='" & params(5)& ",'Number='"
strSQL=strSQL & params(6) & "' WHERE USERID= " & Ctype
(e.Item.Cells(0).Controls(1),Label).text
ExecuteStatement(strSQL)
response.write(Blngo)
Return BlnGo
End Function

Here is the datagrid code:
<asp:Datagrid id="MyDatagrid" runat="server"
Bordercolor="black"
gridlines="vertical"
cellpadding="4"
Cellspacing="0"
Width="300"
Font-Names="arial"
Font-Size="8pt"
ShowFooter="true"
HeaderStyle-BackColor="#cccc99"
FooterStyle-BackColor="#cccc99"
Itemstyle-BackColor="#ffffff"
AlternatingItemstyle-Backcolor="#cccccc"
Autogeneratecolumns="false"
OnEditCommand=" MyDatagrid_Edit"
OnCancelCommand="MyDatagrid_Cancel"
OnUpdateCommand="MyDatagrid_Update"
OnDeleteCommand="MyDatagrid_Delete"
OnPageIndexChanged="MyDatagrid_PageIndexChanged">

<Columns>
<asp:BoundColumn HeaderText="Name" Datafield="Name" />
<asp:BoundColumn HeaderText="Email" Datafield="Emailaddress" />
<asp:BoundColumn HeaderText="Message" Datafield="Message" />
<asp:BoundColumn HeaderText="Frequency" Datafield="Frequency" />
<asp:BoundColumn HeaderText="Times" Datafield="Times" />
<asp:BoundColumn HeaderText="Start_date" Datafield="Start_date" />
<asp:BoundColumn HeaderText="Number" Datafield="Number" />

<asp:EditCommandColumn
EditText="Edit"
UpdateText="Update"
CancelText="Cancel"
Itemstyle-Wrap="False"
HeaderText="Edit"/>

<asp:ButtonColumn HeaderText="Delete?" text="X"
CommandName="Delete" ButtonType="Pushbutton"/>


</Columns>
</asp:Datagrid>

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on "If UpdateDataStore then" Is this right syntax? Or get search suggestion and latest updates.




Tagged: