gpt4 book ai didi

c# - 如何使用 ADO.NET GetSchema() 只获取用户定义的存储过程?

转载 作者:太空宇宙 更新时间:2023-11-03 10:25:49 30 4
gpt4 key购买 nike

Connection.GetSchema["Procedures"] 返回所有存储过程,包括系统。我如何限制它只返回用户定义的存储过程?

最佳答案

您可以向 GetSchema 方法添加限制

string[] restrictions = new string[] { null, null, null, "P" };
var x = connection.GetSchema("Procedures", restrictions);

根据 MSDN GetSchema reference .如果您查看 Procedures 部分,Procedure 的第 4 个参数Type

我没有打开任何代码,所以我不能 100% 确定上面的方法是否有效,但它肯定会让你走上正轨。

关于c# - 如何使用 ADO.NET GetSchema() 只获取用户定义的存储过程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31613627/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com