Click here to Skip to main content
16,006,065 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: GridView column visible property Pin
minhpc_bk24-Aug-06 15:35
minhpc_bk24-Aug-06 15:35 
GeneralRe: GridView column visible property Pin
Naveed Kamboh25-Aug-06 1:42
Naveed Kamboh25-Aug-06 1:42 
QuestionDifference [modified] Pin
kjosh24-Aug-06 10:13
kjosh24-Aug-06 10:13 
AnswerRe: Difference Pin
Guffa24-Aug-06 10:46
Guffa24-Aug-06 10:46 
QuestionCalling Web service Pin
kjosh24-Aug-06 8:53
kjosh24-Aug-06 8:53 
AnswerRe: Calling Web service Pin
minhpc_bk24-Aug-06 16:21
minhpc_bk24-Aug-06 16:21 
AnswerRe: Calling Web service Pin
postmaster@programmingknowledge.com24-Aug-06 17:46
postmaster@programmingknowledge.com24-Aug-06 17:46 
QuestionTyped DataSet and ObjectDataSource Issue Pin
student_rhr24-Aug-06 8:28
student_rhr24-Aug-06 8:28 

I am working on creating a DAL and BLL for my app. DAL and BLL works great for Delete and Select statements but when it comes to update the data using GridView (which is the only control I've tried) I am not having any success. This is the error msg I am getting:


ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateForum' that has parameters: ForumID, forumName, forumDescription, Name, Description.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateForum' that has parameters: ForumID, forumName, forumDescription, Name, Description.


The problem is my method does not have parameters named Name & Description and I can't figure out why the GridView is passing Name and Description as parameters!


This is what my BLL method for update looks like:


[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
public bool UpdateForum(int forumID, string forumName, string forumDescription)
{



ForumDataSet.ForumsDataTable forums = Adapter.GetForumsByForumID(forumID);
if (forums.Count == 0)
{
// no matching record found; hence return false
return false;
}


ForumDataSet.ForumsRow forum = forums[0];
forum.Name = forumName;
forum.Description = forumDescription;
forum.ForumID = forumID;
// Update the product record
int rowsAffected = Adapter.Update(forum);
// Return true if precisely one row was updated, otherwise false
return rowsAffected == 1;


}


My parameter list in DataSource looks like this:


<UpdateParameters>
<asp:Parameter Name="forumID" Type="Int32" />
<asp:Parameter Name="forumName" Type="String" />
<asp:Parameter Name="forumDescription" Type="String" />
</UpdateParameters>


And my GridView looks like this:


<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ForumID" DataSourceID="ObjectDataSource1">


<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="ForumID" HeaderText="ForumID" InsertVisible="False" ReadOnly="false" SortExpression="ForumID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
</Columns>


</asp:GridView>


And my Data Set .xsd:


<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="False">
<
CommandText>UPDATE [Forums] SET [Name] = @Name, [Description] = @Description WHERE (([ForumID] = @Original_ForumID))</CommandText>
<
Parameters>
<
Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Current">
</
Parameter>
<
Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="False" SourceVersion="Current">
</
Parameter>
<
Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ForumID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ForumID" SourceColumnNullMapping="False" SourceVersion="Original">
</
Parameter>
</
Parameters>
</
DbCommand>
</
UpdateCommand>


Thanks in advance.
AnswerRe: Typed DataSet and ObjectDataSource Issue Pin
minhpc_bk24-Aug-06 16:23
minhpc_bk24-Aug-06 16:23 
AnswerRe: Typed DataSet and ObjectDataSource Issue Pin
MIHAI_MTZ24-Aug-06 20:25
MIHAI_MTZ24-Aug-06 20:25 
Questiondata type: BIT Pin
Rory Lewis24-Aug-06 7:36
Rory Lewis24-Aug-06 7:36 
AnswerRe: data type: BIT [modified] Pin
Jon Sagara24-Aug-06 8:00
Jon Sagara24-Aug-06 8:00 
GeneralRe: data type: BIT Pin
Rory Lewis24-Aug-06 23:44
Rory Lewis24-Aug-06 23:44 
QuestionBuilding a web page Pin
nannapanenikamalnath24-Aug-06 7:19
nannapanenikamalnath24-Aug-06 7:19 
AnswerRe: Building a web page Pin
minhpc_bk24-Aug-06 16:27
minhpc_bk24-Aug-06 16:27 
QuestionASP.NET stopping the load event of a form from running again? Pin
Solly7424-Aug-06 6:54
Solly7424-Aug-06 6:54 
AnswerRe: ASP.NET stopping the load event of a form from running again? Pin
ToddHileHoffer24-Aug-06 7:04
ToddHileHoffer24-Aug-06 7:04 
GeneralRe: ASP.NET stopping the load event of a form from running again? Pin
Solly7424-Aug-06 7:08
Solly7424-Aug-06 7:08 
GeneralRe: ASP.NET stopping the load event of a form from running again? Pin
Solly7424-Aug-06 7:33
Solly7424-Aug-06 7:33 
QuestionUrgent ! Footertext problem Pin
cheeken2u24-Aug-06 6:46
cheeken2u24-Aug-06 6:46 
AnswerRe: Urgent ! Footertext problem Pin
Solly7424-Aug-06 7:00
Solly7424-Aug-06 7:00 
GeneralRe: Urgent ! Footertext problem Pin
cheeken2u24-Aug-06 7:17
cheeken2u24-Aug-06 7:17 
GeneralRe: Urgent ! Footertext problem Pin
_AK_24-Aug-06 20:48
_AK_24-Aug-06 20:48 
QuestionJavaScript Pin
kjosh24-Aug-06 5:40
kjosh24-Aug-06 5:40 
AnswerRe: JavaScript Pin
ToddHileHoffer24-Aug-06 5:49
ToddHileHoffer24-Aug-06 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.