简体   繁体   中英

How do I use Entity framework to call a stored procedure when it exists in a schema different to dbo?

My DBA has moved all my SQL Server stored procedures from the dbo schema to a different schema. As a result of this, my EF code can no longer find my stored procedures. I'm aware of the table attribute in which I can specify a different schema. However, I need to specify the schema in which the stored procedure exists.

只需在proc之前将模式与点连接:

sqlString = "Exec " + ConnectiontoSql.GetSchemaName() + ".spName .......

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM