public static object ExecuteScalar(string SQL)
{
try
{
var A = new EGModel.EGEntity().Connection;
var command = ((EntityConnection)(A)).StoreConnection.CreateCommand();
command.CommandType = System.Data.CommandType.Text;
command.CommandText = SQL;
if (((EntityConnection)(A)).StoreConnection.State == System.Data.ConnectionState.Closed)
((EntityConnection)(A)).StoreConnection.Open();
return command.ExecuteScalar();
}
catch { return null; }
}
public object MFICHE(int ID)
{
var i = from b in IConnection.EGEntity().fiche
where (m.ID== ID)
select new { b.Date, m.Name, Addresss = IConnection.ExecuteScalar("SELECT main.F_ADDRESS(4588)") };
return i;
}
나는 점점 오전 오류를 선택 상점 표현식으로 변환 할 수 없습니다. 왜 오류가 발생합니까?LINQ는 새로운
하지만 주소 = "ASASAS"가 실행 중입니까?
가능한 복제본 : http://stackoverflow.com/questions/6998957/how-to-call-scalar-valued-function-from-linq-to-entities-server-side – Akhil
은 "main.F_ADDRESS (4588)입니다.) "모든 함수 또는 sp – ethicallogics
예, F_ADDRESS는 mysql 함수, –