Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'People_S
ave' expects parameter '@Address', which was not supplied.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand
 cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run
Behavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBe
havior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 time
out, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameter
EncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav
ior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletio
nSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSou
rce`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean
asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at PeopleManage.BusinessLogic.Person.Save() in c:\Users\Aref\Documents\Visual
 Studio 2013\Projects\PeopleManage\PeopleManage.BusinessLogic\Person.cs:line 48
ClientConnectionId:259a2369-c1d6-4ea6-8e85-e2824f4d2340
Error Number:201,State:4,Class:16
Posted
Updated 23-Jul-15 21:40pm
v3
Comments
F-ES Sitecore 24-Jul-15 3:58am    
The error message is self-explanatory, without posting the code there is nothing anyone can do to help.

1 solution

Based on the error you can connect to the database, but your call for People_Save stored procedure is wrong. You haven't defined any value for parameter @Address
 
Share this answer
 
Comments
Member 11859971 24-Jul-15 4:40am    
it does not work
Member 11859971 24-Jul-15 4:41am    
i have method save
public bool Save()
{
try
{
var dt = new DataTools();
dt.Command.CommandText = "People_Save";
dt.Command.Parameters.AddWithValue("@FirstName", FirstName);
dt.Command.Parameters.AddWithValue("@LastName", LastName);
dt.Command.Parameters.AddWithValue("@PhoneNumber", PhoneNumber);
dt.Command.Parameters.AddWithValue("@HomeAddress", HomeAddress);
dt.Connection.Open();
dt.Command.ExecuteNonQuery();
if (dt.Connection.State == ConnectionState.Open)
{
dt.Connection.Close();
}
return true;
}
catch (Exception exception)
{
Console.WriteLine(exception.ToString());
throw;
Wendelius 24-Jul-15 4:47am    
What is the definition for the stored procedure?
Member 11859971 24-Jul-15 6:51am    
thank for help
it work
Wendelius 24-Jul-15 7:17am    
Glad to hear that :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900