asp.net中实现拼音首字母查询
在sql里面新建自定义函数,代码如下:
CREATE function fun_getPY(@str nvarchar(4000))
returns nvarchar(4000)
as
begin
declare @word nchar(1),@PY nvarchar(4000)
set @PY=''
while len(@str)>0
begin
set @word=left(@str,1)
--如果非汉字字符,返回原字符
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
then (select top 1 PY from (
select 'A' as PY,N'驁' as word
union all select 'B',N'簿'
union all select 'C',N'錯'
union all select 'D',N'鵽'
union all select 'E',N'樲'
union all select 'F',N'鰒'
union all select 'G',N'腂'
union all select 'H',N'夻'
union all select 'J',N'攈'
union all select 'K',N'穒'
union all select 'L',N'鱳'
union all select 'M',N'旀'
union all select 'N',N'桛'
union all select 'O',N'漚'
union all select 'P',N'曝'
union all select 'Q',N'囕'
union all select 'R',N'鶸'
union all select 'S',N'蜶'
union all select 'T',N'籜'
union all select 'W',N'鶩'
union all select 'X',N'鑂'
union all select 'Y',N'韻'
union all select 'Z',N'咗'
) T
where word>=@word collate Chinese_PRC_CS_AS_KS_WS
order by PY ASC) else @word end)
set @str=right(@str,len(@str)-1)
end
return @PY
end
在程序中直接调用就可以了
相关文档:
先看看ASP.NET页面刷新的实现方法:
第一:
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); }
第二:
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.locat ......
一、Response对象
Response对象是HttpResponse类的一个实例。该类主要是封装来自ASP.NET操作的HTTP响应信息。
1.Response对象的属性
① BufferOutput
说明:获取或设置一个值,该值指示是否缓冲输出,并在完成处理整个页之后将其发送
属性值:如果缓冲了到客户端的输出, ......
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
1.首先运行SQLServer
2.然后运行C:\WINDOWS\Microsoft.NET\Framework\v2.0.5072 ......
FCKeditor是一个功能强大支持所见即所得功能的文本编辑器,可以为用户提供微软office软件一样的在线文档编辑服务。
详细出处参考:http://www.jb51.net/article/21769.htm
它不需要安装任何形式的客户端,兼容绝大多数主流浏览器,支持ASP.Net、ASP、ColdFusion 、PHP、Java、Active-FoxPro、Lasso、Perl、ython 等编程环 ......
1、Web.config 可以采用写连接条件 或 附加 ×.mdf 文件
<connectionStrings>
<add name="Sales"
providerName="System.Data.SqlClient"
connectionString= "server=myserver;database=Products;uid=<user name&g ......