Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.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/1/asp.net/31.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/3/sockets/2.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# 为什么AddWithValue()在没有@的情况下工作?_C#_Asp.net_Parameters - Fatal编程技术网

C# 为什么AddWithValue()在没有@的情况下工作?

C# 为什么AddWithValue()在没有@的情况下工作?,c#,asp.net,parameters,C#,Asp.net,Parameters,为什么我的代码在使用时有效: command.Parameters.AddWithValue("user", user); 应该在什么时候(根据互联网): 该方法是否支持不带@的参数名?根据我的经验,这两种方法对于与SQL Server接口的.NET应用程序是等效的 我个人使用带有@签名的符号。根据我的经验,这两种符号对于与SQL Server接口的.NET应用程序是等效的 我个人使用带有@签名的符号。那么,在与我的SQL、Oracle等其他数据库系统交互时,我们需要使用@吗?@sudhaka

为什么我的代码在使用时有效:

command.Parameters.AddWithValue("user", user);
应该在什么时候(根据互联网):


该方法是否支持不带@的参数名?

根据我的经验,这两种方法对于与SQL Server接口的.NET应用程序是等效的


我个人使用带有
@
签名的符号。

根据我的经验,这两种符号对于与SQL Server接口的.NET应用程序是等效的


我个人使用带有
@
签名的符号。

那么,在与我的SQL、Oracle等其他数据库系统交互时,我们需要使用@吗?@sudhakardipudi不需要,我不这么认为。在我看来,人们使用
@
AddWithValue
方法是因为它熟悉参数化存储过程。那么,在与我的SQL、Oracle等其他数据库系统交互时,我们是否需要使用@?@sudhakardipudi没有必要,我不这么认为。在我看来,人们正在使用
@
AddWithValue
方法,因为它熟悉参数化存储过程。
command.Parameters.AddWithValue("@user", user);