C#:当前上下文中不存在名称“localQBD” [英] C#: The name 'localQBD' does not exist in the current context

查看:107
本文介绍了C#:当前上下文中不存在名称“localQBD”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

肯定会感谢有人指出我正确的方向:在我的错误列表中使用VS2013当前上下文中不存在名称'localQBD'。



Would sure appreciate someone pointing me in the right direction: Using VS2013 which has in my error list "The name 'localQBD' does not exist in the current context."

rp.OpenConnection2("", "Sample Code from OSR", localQBD);





当我突出显示'OpenConnection2'并按F12转到定义时,我看到:



When I highlight 'OpenConnection2' and press F12 to Go to Definition, I see:

[DispId(15)]
        void OpenConnection2(string appID, string appName, QBXMLRPConnectionType connPref);





当我突出显示QBXMLRPConnectionType并按F12键转到定义,我看到:



When I highlight QBXMLRPConnectionType and press F12 to Go to Definition, I see:

public enum QBXMLRPConnectionType
    {
        unknown = 0,
        localQBD = 1,
        remoteQBD = 2,
        localQBDLaunchUI = 3,
        remoteQBOE = 4,
    }





如何诊断为什么我我收到错误信息?



谢谢 -



How can I diagnose why I am getting the error message?

Thanks--

推荐答案

你不应该编程,特别是这样的ADO.NET等高级主题,无需阅读语言语法和其他基础知识。除非你正确地学习语言,否则我可以预见会有更多的问题和挫折导致你无处可去。



也许你的意思是 QBXMLRPConnectionType.localQBD ,而不是你写的。 :-)



-SA
You should not do programming, especially such advanced topics as ADO.NET, without reading in language syntax and other basics. I can foresee a lot more problems and frustrations leading you nowhere, unless you properly learn the language.

Perhaps you meant QBXMLRPConnectionType.localQBD, instead of what you have written. :-)

—SA


谢谢Matt--非常感谢。
Thanks Matt-- Much appreciated.


谢谢谢尔盖 - 是的,谢谢:更改线路如下解决问题:



Thanks Sergey - yes, thanks: changing the line as follows resolves the problem:

rp.OpenConnection2("", "Sample Code from OSR", QBXMLRPConnectionType.localQBD);





但是,这不是我的代码,它是Intuit的。因此,令我惊讶的是,需要这样的更改才能让他们的代码运行,这让我想知道:



C#中没有办法在没有代码的情况下引用枚举添加这样的前缀?



However, this is not my code, it is Intuit's. So it is surprising to me such a change is required to get their code to run, which makes me wonder:

Is there not a way in C# to reference enums without adding such a prefix?


这篇关于C#:当前上下文中不存在名称“localQBD”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆