Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# C使用Access视图而不是自定义查询_C#_Sql_Oledb_Sql View - Fatal编程技术网

C# C使用Access视图而不是自定义查询

C# C使用Access视图而不是自定义查询,c#,sql,oledb,sql-view,C#,Sql,Oledb,Sql View,前言:关于使用SQL视图的C语言有很多问题,但我还没有找到与我的问题相近的东西 我正在使用C Visual Studio 2015创建一个Excel 2010插件。在后端,我需要使用Access 2010。我在Access中创建了一个需要传递一个参数的视图 与其在command.CommandText中键入整个查询,我只想使用视图并绑定它需要运行的单个参数 任何帮助都将不胜感激 使用类似于表的视图 command.CommandText = "select qry_setpoints where

前言:关于使用SQL视图的C语言有很多问题,但我还没有找到与我的问题相近的东西

我正在使用C Visual Studio 2015创建一个Excel 2010插件。在后端,我需要使用Access 2010。我在Access中创建了一个需要传递一个参数的视图

与其在command.CommandText中键入整个查询,我只想使用视图并绑定它需要运行的单个参数

任何帮助都将不胜感激

使用类似于表的视图

command.CommandText = "select qry_setpoints where ID = @ID";  
command.Parameters.Add("@ID", OleDbType.Integer).Value = xID;    
使用类似于表的视图

command.CommandText = "select qry_setpoints where ID = @ID";  
command.Parameters.Add("@ID", OleDbType.Integer).Value = xID;    

command.CommandText=select*from qry_设置点?command.CommandText=select*from qry_设置点?对-只有当它是一个存储过程而不是视图查询时,操作代码才可以,除非它们将CommandType设置为adCmdStoredProc。谢谢大家。有些东西很简单,我就是看不到:对-只有当它是一个存储过程而不是一个视图查询时,操作代码才会很好,只是他们会将CommandType设置为adCmdStoredProc。谢谢大家。简单到我看不见的东西: