DELETE FROM Attendance_Table
WHERE
(Day_Dat = getdate())
it gives me error of
Procedure procedure_name has no parameters and arguments were supplied.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Akkiraju IvaturiPosted Jan 20, 2013, 6:32 PM
By the way the error says that you have created a stored procedure called procedure_name which does not accept any parameters. But you were trying to pass parameters to the stored procedure which it cannot handle and so giving the error.
ahmed fahdPosted Jan 22, 2013, 3:10 AM
Jignesh TrivediPosted Jan 22, 2013, 3:06 AM
i have try following code C# with SQL server. it working fine for me.
SqlConnection con = new SqlConnection("Data Source=.\SQLExpress;user id=sa;password=tiger1!;Initial Catalog=TempDBforTest;MultipleActiveResultSets=True");
SqlCommand command = new SqlCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "Attendance_Table_Delete";
command.Connection = con;
con.Open();
int res = command.ExecuteNonQuery();
con.Close();
CREATE PROCEDURE dbo.Attendance_Table_Delete
as
DELETE FROM Attendance_Table WHERE (Day_Dat =convert(date, GETDATE()))
hope this will help you.
ahmed fahdPosted Jan 22, 2013, 2:39 AM
Jignesh TrivediPosted Jan 20, 2013, 11:17 PM
I think this error is due to mismatch between Parameter of SP and Pass parameter to call SP from Code.
Also Check direction of SP parameter. whether parameter is define input/output ect.
yes agree with Akkiraju,
please share you SP .