Reputation: 77
When I run this code and watch in SQL Server Profiler, there is no return value
exec [dbo].[p_PersonelEkleAgiGetir]
@MedeniDurum = N'Evli',
@CocukSayisi = 0,
@EsCalismaDurumu = N'Çalışmıyor'
I erased the N
from in front of the parameters and then it works. What do I have to do for this to work in the code?
This is my entity procedure code
public virtual ObjectResult<Nullable<decimal>> p_PersonelEkleAgiGetir(string medeniDurum, Nullable<int> cocukSayisi, string esCalismaDurumu)
{
var medeniDurumParameter = medeniDurum != null ?
new ObjectParameter("MedeniDurum", medeniDurum) :
new ObjectParameter("MedeniDurum", typeof(string));
var cocukSayisiParameter = cocukSayisi.HasValue ?
new ObjectParameter("CocukSayisi", cocukSayisi) :
new ObjectParameter("CocukSayisi", typeof(int));
var esCalismaDurumuParameter = esCalismaDurumu != null ?
new ObjectParameter("EsCalismaDurumu", esCalismaDurumu) :
new ObjectParameter("EsCalismaDurumu", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Nullable<decimal>>("p_PersonelEkleAgiGetir", medeniDurumParameter, cocukSayisiParameter, esCalismaDurumuParameter);
}
Upvotes: 0
Views: 76
Reputation: 1255
If I understand your question well, you want to know why deleting the N
s makes it run correctly but with the N
s it doesn't run. The N
indicates that the string is a Unicode
. When you erase them, the procedure accepts it because it accepts non-Unicode strings. You can see more information here:
What is the meaning of the prefix N in T-SQL statements?
Upvotes: 1