SQL预测参数 [英] SQL EXPECTS THE PARAMETER

查看:81
本文介绍了SQL预测参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我使用SQL Server 2012来存储来自asp.net网页gridview的数据。



问题是,如果任何列留空,则会出现上述错误消息SQL expect参数未提供。插入以及更新命令正在发生。



SQL允许字段为空,SQL管理工作室中的直接查询工作正常。



请使用指南。



谢谢,

Atul

Hi All,

I am using SQL server 2012 to store data from asp.net webpage gridview.

The issue is that if any column is left blank the above error message of 'SQL expects parameter not supplied' shows up. It is happening for Insert as well as Update commands.

The fields are allowed null in SQL and a direct query in SQL management studio is working fine.

Pls Guide.

Thanks,
Atul

推荐答案

将参数发送到数据库时,该值不能为NULL。然后不会发送参数。如果var为NULL,则将其更改为DBNULL.Value。
when sending a parameter to a database the value cannot be NULL. The parameter will not be send then. If a var in NULL then change it to DBNULL.Value.


这篇关于SQL预测参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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