让地址看起来更好 [英] Make Address Look Better

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

问题描述

VB.Net


我从数据库中提取数据并通过填写标签创建一个字母。它

完美无缺,但如果Addr2和Addr3为空,则在该区域留下一个空格

。有没有办法让它如此我可以说数据是否为空,

暂时删除标签或使其不存在?我不是在谈论

只是隐藏它因为它仍然留下了一个空间。


这就是我得到的:

FirstName LastName

Addr1

Addr2(如果没有数据,这是空白的)

Addr3(如果没有数据,这是空白的)

City,State ZIP


这是我想要的Addr2& Addr3是空白的:

FirstName LastName

Addr1

City,State ZIP


这是我的代码:

如果不是dr.Item(" CustodianAddress2")。ToString = String.Empty那么


CustAddr2L.Text = dr.Item(" CustodianAddress2")


结束如果


如果不是dr.Item(" CustodianAddress3")。ToString = String.Empty那么


CustAddr3L.Text = dr.Item(" CustodianAddress3")

结束如果

VB.Net

I''m pulling Data from a DB and creating a letter by filling the Labels. It
works perfectly, but if Addr2 and Addr3 are blank, it leaves a Blank space
in that area. Is there a way to make it so I can say if the data is empty,
temporarely delete the label or make it not exist at all? I''m not talking
about just hiding it because it still leaves an empy space.

This is what I get:
FirstName LastName
Addr1
Addr2 (this is blank if no data)
Addr3 (this is blank if no data)
City, State ZIP

This is what I want to get if Addr2 & Addr3 are blank:
FirstName LastName
Addr1
City, State ZIP

Here is my Code:
If Not dr.Item("CustodianAddress2").ToString = String.Empty Then

CustAddr2L.Text = dr.Item("CustodianAddress2")

End If

If Not dr.Item("CustodianAddress3").ToString = String.Empty Then

CustAddr3L.Text = dr.Item("CustodianAddress3")

End If

推荐答案

不要使用CustAddr2L和CustAddr3L只需将所有内容添加到CustAddr1L

如果CustAddr2L和CustAddr3L退出然后添加到CustAddr1L

这样你就不要不需要删除任何东西。


" pvong" < phillip * at * yahoo * dot * comwrote in message

news:OD ************** @ TK2MSFTNGP02.phx.gbl ...
Don''t use CustAddr2L and CustAddr3L Just add everything to CustAddr1L
if CustAddr2L and CustAddr3L exit then add then to CustAddr1L
This way you don''t need to remove anything.

"pvong" <phillip*at*yahoo*dot*comwrote in message
news:OD**************@TK2MSFTNGP02.phx.gbl...

VB.Net

我从数据库中提取数据并通过填写标签来创建一个字母。

它工作正常,但如果Addr2和Addr3为空,则在该区域留下一个空白

空间。有没有办法让它如此我可以说如果数据是空的b / b,是暂时删除标签还是根本不存在?我不是在谈论隐藏它,因为它仍然留下了一个空间。


这就是我得到的:

FirstName LastName

Addr1

Addr2(如果没有数据,这是空白的)

Addr3(如果没有数据,这是空白的)

City,State ZIP


这是我想要的Addr2& Addr3是空白的:

FirstName LastName

Addr1

City,State ZIP


这是我的代码:

如果不是dr.Item(" CustodianAddress2")。ToString = String.Empty那么


CustAddr2L.Text = dr.Item(" CustodianAddress2")


结束如果


如果不是dr.Item(" CustodianAddress3")。ToString = String.Empty那么


CustAddr3L.Text = dr.Item(" CustodianAddress3")

结束如果

VB.Net

I''m pulling Data from a DB and creating a letter by filling the Labels.
It works perfectly, but if Addr2 and Addr3 are blank, it leaves a Blank
space in that area. Is there a way to make it so I can say if the data is
empty, temporarely delete the label or make it not exist at all? I''m not
talking about just hiding it because it still leaves an empy space.

This is what I get:
FirstName LastName
Addr1
Addr2 (this is blank if no data)
Addr3 (this is blank if no data)
City, State ZIP

This is what I want to get if Addr2 & Addr3 are blank:
FirstName LastName
Addr1
City, State ZIP

Here is my Code:
If Not dr.Item("CustodianAddress2").ToString = String.Empty Then

CustAddr2L.Text = dr.Item("CustodianAddress2")

End If

If Not dr.Item("CustodianAddress3").ToString = String.Empty Then

CustAddr3L.Text = dr.Item("CustodianAddress3")

End If



我在那里放了什么,所以它包含一个< BRto it'并不是全部在同一个

行?这是我的新代码,它们都在一起运行。我知道如何在两者之间放置1

空间,但是如何设置返回字符?

CustAddr1L.Text = dr.Item(" CustodianAddress1")&

dr.Item(" CustodianAddress2")& dr.Item(CustodianAddress3)


" IfThenElse" < sq ********** @ hotmail.comwrote in message

news:er ************** @ TK2MSFTNGP05.phx.gbl ...
What do I put in there so it will include a <BRto it''s not all on the same
line? This is my new code and they all run together. I know how to put 1
space in between, but how do you put a return character?
CustAddr1L.Text = dr.Item("CustodianAddress1") &
dr.Item("CustodianAddress2") & dr.Item("CustodianAddress3")

"IfThenElse" <sq**********@hotmail.comwrote in message
news:er**************@TK2MSFTNGP05.phx.gbl...

不要使用CustAddr2L和CustAddr3L只需将所有内容添加到CustAddr1L

如果CustAddr2L和CustAddr3L退出然后添加到CustAddr1L

这种方式你不需要删除任何东西。


" pvong" < phillip * at * yahoo * dot * comwrote in message

news:OD ************** @ TK2MSFTNGP02.phx.gbl ...
Don''t use CustAddr2L and CustAddr3L Just add everything to CustAddr1L
if CustAddr2L and CustAddr3L exit then add then to CustAddr1L
This way you don''t need to remove anything.

"pvong" <phillip*at*yahoo*dot*comwrote in message
news:OD**************@TK2MSFTNGP02.phx.gbl...

> VB.Net

我正在从数据库中提取数据并通过填写标签来创建一个字母。
它的工作原理完美,但如果Addr2和Addr3为空,则在该区域留下一个空白
空间。有没有办法让它如此我可以说如果数据是空的,暂时删除标签或使其根本不存在?我不是在谈论隐藏它,因为它仍然留下了一个空间。

这就是我得到的:
FirstName LastName
Addr1
Addr2(如果没有数据,这是空白的)
Addr3(如果没有数据,这是空白的)
City,State ZIP

这是我想要的Addr2& Addr3是空白的:
FirstName LastName
Addr1
城市,状态ZIP

这是我的代码:
如果不是dr.Item(" CustodianAddress2" ).ToString = String.Empty然后

CustAddr2L.Text = dr.Item(CustodianAddress2)

结束如果

如果不是博士.Item(" CustodianAddress3")。ToString = String.Empty然后

CustAddr3L.Text = dr.Item(" CustodianAddress3")

结束如果

>VB.Net

I''m pulling Data from a DB and creating a letter by filling the Labels.
It works perfectly, but if Addr2 and Addr3 are blank, it leaves a Blank
space in that area. Is there a way to make it so I can say if the data
is empty, temporarely delete the label or make it not exist at all? I''m
not talking about just hiding it because it still leaves an empy space.

This is what I get:
FirstName LastName
Addr1
Addr2 (this is blank if no data)
Addr3 (this is blank if no data)
City, State ZIP

This is what I want to get if Addr2 & Addr3 are blank:
FirstName LastName
Addr1
City, State ZIP

Here is my Code:
If Not dr.Item("CustodianAddress2").ToString = String.Empty Then

CustAddr2L.Text = dr.Item("CustodianAddress2")

End If

If Not dr.Item("CustodianAddress3").ToString = String.Empty Then

CustAddr3L.Text = dr.Item("CustodianAddress3")

End If




如果重要的话,我正在使用WebForm。

" ; IfThenElse" < sq ********** @ hotmail.comwrote in message

news:er ************** @ TK2MSFTNGP05.phx.gbl ...
I''m using WebForm if that matters.
"IfThenElse" <sq**********@hotmail.comwrote in message
news:er**************@TK2MSFTNGP05.phx.gbl...

不要使用CustAddr2L和CustAddr3L只需将所有内容添加到CustAddr1L

如果CustAddr2L和CustAddr3L退出然后添加到CustAddr1L

这种方式你不需要删除任何东西。


" pvong" < phillip * at * yahoo * dot * comwrote in message

news:OD ************** @ TK2MSFTNGP02.phx.gbl ...
Don''t use CustAddr2L and CustAddr3L Just add everything to CustAddr1L
if CustAddr2L and CustAddr3L exit then add then to CustAddr1L
This way you don''t need to remove anything.

"pvong" <phillip*at*yahoo*dot*comwrote in message
news:OD**************@TK2MSFTNGP02.phx.gbl...

> VB.Net

我正在从数据库中提取数据并通过填写标签来创建一个字母。
它的工作原理完美,但如果Addr2和Addr3为空,则在该区域留下一个空白
空间。有没有办法让它如此我可以说如果数据是空的,暂时删除标签或使其根本不存在?我不是在谈论隐藏它,因为它仍然留下了一个空间。

这就是我得到的:
FirstName LastName
Addr1
Addr2(如果没有数据,这是空白的)
Addr3(如果没有数据,这是空白的)
City,State ZIP

这是我想要的Addr2& Addr3是空白的:
FirstName LastName
Addr1
城市,状态ZIP

这是我的代码:
如果不是dr.Item(" CustodianAddress2" ).ToString = String.Empty然后

CustAddr2L.Text = dr.Item(CustodianAddress2)

结束如果

如果不是博士.Item(" CustodianAddress3")。ToString = String.Empty然后

CustAddr3L.Text = dr.Item(" CustodianAddress3")

结束如果

>VB.Net

I''m pulling Data from a DB and creating a letter by filling the Labels.
It works perfectly, but if Addr2 and Addr3 are blank, it leaves a Blank
space in that area. Is there a way to make it so I can say if the data
is empty, temporarely delete the label or make it not exist at all? I''m
not talking about just hiding it because it still leaves an empy space.

This is what I get:
FirstName LastName
Addr1
Addr2 (this is blank if no data)
Addr3 (this is blank if no data)
City, State ZIP

This is what I want to get if Addr2 & Addr3 are blank:
FirstName LastName
Addr1
City, State ZIP

Here is my Code:
If Not dr.Item("CustodianAddress2").ToString = String.Empty Then

CustAddr2L.Text = dr.Item("CustodianAddress2")

End If

If Not dr.Item("CustodianAddress3").ToString = String.Empty Then

CustAddr3L.Text = dr.Item("CustodianAddress3")

End If




这篇关于让地址看起来更好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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