This is for an asp.net 2.0 site, but I think the VB should be similiar.
I am using an access datasource, I set up a sub update db that checks the textboxes and updateds the Database. Basically I want a fully editable Gridview. i think Sqlcommandevent args is what i need I believe sql and access share some properties. Here is my error, my code is below that. I understand(i think) why i am getting the error but I am not sure how to correct it.
BC30408: Method 'Public Sub Updatedb(sender As Object, e As System.Web.UI.WebControls.SqlDataSourceCommandEven tArgs)' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
Source Error:
Line 126: <div style="z-index: 103; left: 307px; width: 65px; position: absolute; top: 653px;
Line 127: height: 28px">
Line 128: <asp:Button ID="Button1" runat="server" Text="Update Tithe" OnClick=Updatedb /></div>
Line 129: <%-- <asp:AccessDataSource ID="Titheupdate" runat="server" DataFile="~/App_Data/tithe/GBCTITHE.MDB"
Line 130: UpdateCommand="UPDATE [Tithe] SET [WkID] = ?, [People_ID] = ?, [Tithe] = ?, [Education] = ?, [Special] = ?, [Missions] = ?, [Gift_Item] = ?, [Gift_Value] = ? WHERE [TRID] = ?">
'I tried it this way too..
'Same type of error for this too
I am using an access datasource, I set up a sub update db that checks the textboxes and updateds the Database. Basically I want a fully editable Gridview. i think Sqlcommandevent args is what i need I believe sql and access share some properties. Here is my error, my code is below that. I understand(i think) why i am getting the error but I am not sure how to correct it.
BC30408: Method 'Public Sub Updatedb(sender As Object, e As System.Web.UI.WebControls.SqlDataSourceCommandEven tArgs)' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
Source Error:
Line 126: <div style="z-index: 103; left: 307px; width: 65px; position: absolute; top: 653px;
Line 127: height: 28px">
Line 128: <asp:Button ID="Button1" runat="server" Text="Update Tithe" OnClick=Updatedb /></div>
Line 129: <%-- <asp:AccessDataSource ID="Titheupdate" runat="server" DataFile="~/App_Data/tithe/GBCTITHE.MDB"
Line 130: UpdateCommand="UPDATE [Tithe] SET [WkID] = ?, [People_ID] = ?, [Tithe] = ?, [Education] = ?, [Special] = ?, [Missions] = ?, [Gift_Item] = ?, [Gift_Value] = ? WHERE [TRID] = ?">
Code:
Sub Updatedb(ByVal sender As Object, ByVal e As SqlDataSourceCommandEventArgs)
Dim dgi As GridViewRow
For Each dgi In GridView1.Rows
'Read in the Primary Key Field
Dim id As Integer = (GridView1.DataKeys(dgi.RowIndex).Value.ToString() )
Dim Titheup As Decimal = CType(dgi.FindControl("TxtTithe"), TextBox).Text
e.Command.Parameters("@Titheup").Value = e.Command.Parameters("@TitheParam").Value
e.Command.Parameters("@id").Value = e.Command.Parameters("@Tridparam").Value
e.Command.Parameters.Remove(e.Command.Parameters("@TitheParam"))
e.Command.Parameters.Remove(e.Command.Parameters("@ID"))
dsoTithe.Update()
Next
End Sub
'Same type of error for this too
Code:
Sub Updatedb(ByVal sender As Object, ByVal e As AccessDataSourceView)
Dim dgi As GridViewRow
For Each dgi In GridView1.Rows
'Read in the Primary Key Field
Dim id As Integer = (GridView1.DataKeys(dgi.RowIndex).Value.ToString() )
Dim Titheup As Decimal = CType(dgi.FindControl("TxtTithe"), TextBox).Text
'e.UpdateParameters.
e.UpdateParameters("@Titheup") = e.UpdateParameters("@TitheParam")
e.UpdateParameters("@id") = e.UpdateParameters("@Tridparam")
e.UpdateParameters.Clear()
dsoTithe.Update()