Plz help, i got the following error when i insert new record using DetailsView and Oracle Procedures.
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'InsertSurvey' that has parameters: DESCRIPTION, startDate, endDate, ISOPEN, SURVEYID, START_DATE, END_DATE.
in app_code folder SurveyDataAccess.cs file is
public static int InsertSurvey(
string description,
DateTime startDate,
DateTime endDate,
int isOPEN)
{
int rowsAffected = 0;
using (OracleConnection connection = ConnectionManager.getSohaibOracleConnection())
{
OracleCommand command = new OracleCommand("INSERTSURVEY", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("P_DESCRIPTION", OracleDbType.Varchar2, 50).Value = description;
command.Parameters.Add("P_START_DATE", OracleDbType.Date).Value = startDate;
command.Parameters.Add("P_END_DATE", OracleDbType.Date).Value = endDate;
command.Parameters.Add("P_ISOPEN", OracleDbType.Int32).Value = isOPEN;
rowsAffected = command.ExecuteNonQuery();
}
return rowsAffected;
}
CREATE OR REPLACE PROCEDURE insertSurvey (
p_DESCRIPTION in survey.description%TYPE,
p_START_DATE in survey.start_date%TYPE,
p_END_DATE in survey.end_date%TYPE,
p_ISOPEN in survey.isopen%TYPE
)
AS
BEGIN
INSERT INTO SURVEY (
DESCRIPTION,
START_DATE,
END_DATE,
ISOPEN )
VALUES (
p_DESCRIPTION,
p_START_DATE,
p_END_DATE,
p_ISOPEN) ;
COMMIT;
END ;
Please help me on this issue or suggest detailed alternate. thanx.
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'InsertSurvey' that has parameters: DESCRIPTION, startDate, endDate, ISOPEN, SURVEYID, START_DATE, END_DATE.
Hi,
You can try adding
OldValuesParameterFormatString="original_{0}"in objectdatasource like this
None
0 Points
4 Posts
'ObjectDataSource' could not find a non-generic method that has parameters some parameters
Jan 31, 2013 08:30 AM|m.awaidus|LINK
Plz help, i got the following error when i insert new record using DetailsView and Oracle Procedures.
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'InsertSurvey' that has parameters: DESCRIPTION, startDate, endDate, ISOPEN, SURVEYID, START_DATE, END_DATE.
in app_code folder SurveyDataAccess.cs file is
and CreateSurvey.aspx file is
and Procedure in Oracle is:
Please help me on this issue or suggest detailed alternate. thanx.
Star
9903 Points
1291 Posts
Re: 'ObjectDataSource' could not find a non-generic method that has parameters some parameters
Jan 31, 2013 09:36 PM|Pengzhen Song - MSFT|LINK
Hi,
You can try adding OldValuesParameterFormatString="original_{0}" in objectdatasource like this
None
0 Points
4 Posts
Re: 'ObjectDataSource' could not find a non-generic method that has parameters some parameters
Feb 01, 2013 01:36 PM|m.awaidus|LINK
negtive. the default set value of ObjectDataSource is {0} and i made changes according to your instruciton but got same error.
None
0 Points
4 Posts
Re: 'ObjectDataSource' could not find a non-generic method that has parameters some parameters
Feb 02, 2013 01:50 AM|m.awaidus|LINK
as you can see, theese two parameters "START_DATE & END_DATE." are automatically adding while i m not adding these. this is the main issue.