如何解决名称未在vb.net中声明 [英] how to solve name is not declared in vb.net

查看:65
本文介绍了如何解决名称未在vb.net中声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误是
未声明名称IIf和DBNull

代码是
cmd.Parameters.Add("@ address2",SqlDbType.VarChar).Value = IIf(Address2.Trim.Length> 0,Address2,DBNull.Value)

Error is
Name IIf and DBNull are not declared

Code is
cmd.Parameters.Add("@address2", SqlDbType.VarChar).Value = IIf(Address2.Trim.Length > 0, Address2, DBNull.Value)

推荐答案

您必须添加对System.Configuration的引用以及使用Imports关键字.

干杯!

—MRB
You''ll have to add a reference to System.Configuration as well as using the Imports keyword.

Cheers!

—MRB


添加行
Imports System.Configuration


请参阅我最近的解决方案如何解决定义的错误 [
Please see my recent solution how to solve defined error[^].

And please avoid re-posting questions. Even though it''s not re-post, you would not need one question if you know the answers to another one.

—SA


这篇关于如何解决名称未在vb.net中声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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