binding GridView

N

nalbayo

First Error Message is like this

ObjectDataSource 'ObjectDataSource1' could not find a non-generic method
'Update' that has parameters: BoardManagerId, BoardName, Description,
IsForAdmin, CreatedDate.

i'm gonna bind BoardManager Data to GridView control ..but,.,error occur....
i really don't know why it is not working... if anyone know please tell
me....??

** this is DataSource ..

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="BoardManagerDatabase"
SelectMethod="Gets" DeleteMethod="Delete" InsertMethod="Add"
UpdateMethod="Update">
<DeleteParameters>
<asp:parameter Name="boardManagerId" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="boardManagerId" Type="Int32" />
<asp:parameter Name="boardName" Type="String" />
<asp:parameter Name="description" Type="String" />
<asp:parameter Name="isForAdmin" Type="Boolean" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="boardName" Type="String" />
<asp:parameter Name="description" Type="String" />
<asp:parameter Name="isForAdmin" Type="Boolean" />
</InsertParameters>
</asp:ObjectDataSource>



** this is BoardManager.cs file...

public static void Update(int boardManagerId, string boardName, string
description, bool isForAdmin)
{
using (SqlConnection connection = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
{
using (SqlCommand command = new
SqlCommand("BoardManager_Update", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new SqlParameter("@BoardManagerId",
boardManagerId));
command.Parameters.Add(new SqlParameter("@BoardName",
boardName));
command.Parameters.Add(new SqlParameter("@Description",
description));
command.Parameters.Add(new SqlParameter("@IsForAdmin",
isForAdmin));
connection.Open();
command.ExecuteNonQuery();
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top