How to implement content prompts in .net text boxes
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