Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/320.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#station的正确语法吗_C#_Asp.net - Fatal编程技术网

这是C#station的正确语法吗

这是C#station的正确语法吗,c#,asp.net,C#,Asp.net,这是C语句的正确语法吗。我在尝试使用Visual Studio时收到以下错误消息 intResult = Convert.ToInt32(cmdSelect.Parameters("RETURN_VALUE").Value); 有人能帮我澄清一下吗 我也在使用以下名称空间 using System; using System.Data; using System.Configuration; using System.Web.Configuration; using System.Collec

这是C语句的正确语法吗。我在尝试使用Visual Studio时收到以下错误消息

intResult = Convert.ToInt32(cmdSelect.Parameters("RETURN_VALUE").Value);
有人能帮我澄清一下吗

我也在使用以下名称空间

using System;
using System.Data;
using System.Configuration;
using System.Web.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.Security;
您希望使用,而不是调用函数,因此应使用方括号:

intResult = Convert.ToInt32(cmdSelect.Parameters["RETURN_VALUE"].Value);
intResult = Convert.ToInt32(cmdSelect.Parameters["RETURN_VALUE"].Value);
应该是:

索引器在c#中是[],在VB.net中是()

在c#中,索引器使用方括号,而不是VB.net中的括号。这应该可以做到:

intResult = Convert.ToInt32(cmdSelect.Parameters["RETURN_VALUE"].Value);

对参数使用[]索引运算符,而不是括号:

intResult = Convert.ToInt32(cmdSelect.Parameters["RETURN_VALUE"].Value);

我猜参数不是一个方法,而是一个索引器。因此,您需要使用
cmdSelect.Parameters[“RETURN\u VALUE”]
5个人为接受而斗争。都在一分钟之内,都有正确的答案。
intResult = Convert.ToInt32(cmdSelect.Parameters["RETURN_VALUE"].Value);
intResult = Convert.ToInt32(cmdSelect.Parameters["RETURN_VALUE"].Value);