Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement content prompts in .net text boxes

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how the .net text box to achieve content tips, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Create databases, tables (sqlserver2008 database I use)

The code is as follows:

CREATE TABLE Ceshi

(

Id VARCHAR (50) PRIMARY KEY NOT NULL

Cname VARCHAR (30)

)

GO

INSERT INTO Ceshi

SELECT NEWID (), 'jack1' UNION

SELECT NEWID (), 'jack2' UNION

SELECT NEWID (), 'jack3' UNION

SELECT NEWID (), 'jack4' UNION

SELECT NEWID (), 'jack5' UNION

SELECT NEWID (), 'peter1' UNION

SELECT NEWID (), 'peter2' UNION

SELECT NEWID (), 'peter3' UNION

SELECT NEWID (), 'peter4' UNION

SELECT NEWID (), 'peter5'

Go

Create a custom function

Create function [dbo]. [f_GetPy] (@ str nvarchar (4000))

Returns nvarchar (4000)

As

Begin

Declare @ strlen int,@re nvarchar 4000

Declare @ t table (chr nchar (1) collate Chinese_PRC_CI_AS,letter nchar (1))

Insert into @ t (chr,letter)

Select'A','A 'union all select' eight','B 'union all

Select 'ZAM','C 'union all select' union all select','D 'union all

Select 'hair','E 'union all select' hair','F 'union all

Select 'union all select','G 'hafnium','H 'union all

Select'no','J 'union all select' cut','K 'union all

Select 'union all select','L 'union all','M'

Select 'union all select','N 'Ooh','O 'union all

Select 'union all select','P 'seven','Q 'union all

Select 'union all select','R 'three','S 'union all

Select'he','T 'union all select' him','W 'union all

Select'Xi','X 'union all select' ya','Y 'union all

Select 'son','Z'

Select @ strlen=len (@ str), @ re='

While @ strlen > 0

Begin

Select top 1 @ re=letter+@re,@strlen=@strlen-1

From @ t a where chr

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report