LeslieLikesLollipops
New Member
The problem I'm having, is that I need to pass in multiple arguments through a button click. I have a repeater object that prints out values from a sqlquery, and the button has arguments that are from that same queryHere is My Repeater:\[code\] <asp:Repeater ID="Edit_Repeater" runat="server" DataSourceID="Edit_Repeater_Source"> <HeaderTemplate> <table class="u_Repeater"> <tr> <th> Group Name: </th> <th> Permission Level: </th> <th> Remove: </th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <%#DataBinder.Eval(Container.DataItem, "Group_Name")%> </td> <td> <%#DataBinder.Eval(Container.DataItem, "Name")%> </td> <td> <asp:Button ID="Submit_Remove" runat="server" Text="Remove Permission" OnClick="Remove_Permission" CommandArgument='<%# Eval("GID") + ";" + Eval("PID") %>' /> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>\[/code\]And here is my code behind:\[code\]protected void Remove_Permission(object sender, CommandEventArgs e) { string[] arg = new string[2]; string[] commandArgs = e.CommandArgument.ToString().Split(';'); float GID = float.Parse(arg[0]); float PID = float.Parse(arg[1]); string UID = User_ID.SelectedValue; using (SqlConnection connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["app_migrationConnectionString"].ConnectionString)) { SqlCommand cmd = new SqlCommand("DELETE FROM Membership WHERE GID = @GID AND PID = @PID AND UID = @UID", connection); cmd.Parameters.Add("@GID", SqlDbType.BigInt, -1); cmd.Parameters["@GID"].Value = http://stackoverflow.com/questions/14463201/GID; cmd.Parameters.Add("@PID", SqlDbType.BigInt, -1); cmd.Parameters["@PID"].Value = http://stackoverflow.com/questions/14463201/PID; cmd.Parameters.Add("@UID", SqlDbType.NVarChar, -1); cmd.Parameters["@UID"].Value = http://stackoverflow.com/questions/14463201/UID; try { connection.Open(); cmd.ExecuteNonQuery(); connection.Close(); } catch (Exception ex) { throw ex; } } }\[/code\]I'm getting no build errors, but when I run the page I get a Compilation Error saying:No overload for 'Remove_Permission' matches delegate 'System.EventHandler'I'm almost positive the code is right, so what is the problem?