全部评论

生成带IP显示的图片 [12.24更新]

正好用到,收藏了~~ 谢谢~~

迎客堂 于 2010, May 28, 6:19 PM 发表该评论

ASP+SQL问题讨论专用

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[stp_wf_MKT_cityReports_V2]
       @cityid varchar(1999),
       @mode char(1),
       @start_date datetime,
       @end_date datetime,
       @lang varchar(2)
AS
       SET NOCOUNT ON;
if @mode = 's'
BEGIN
create table #temp
(
ss varchar(20) not null
)
declare @result varchar(2000)
set @result =' insert into #temp(ss) select '''+replace(@cityid,',','''union select''')+''''
exec(@result)


       select
       a.cityId as cityid
       ,cast((case when a.category = 'v' then a.dtplscore else '9999' end) as decimal(6,2)) as dtplscore
       ,cast((a.dhlscore) as decimal(6,2)) as dhlscore
       ,cast((a.disnearleaderscore) as decimal(6,2)) as disnearleaderscore
       ,cast((case when a.category = 'v' then a.ctplscore else '9999' end) as decimal(6,2)) as ctplscore
       ,cast((a.chlscore) as decimal(6,2)) as chlscore
       ,cast((a.cisnearleaderscore) as decimal(6,2)) as cisnearleaderscore
       ,cast((case when a.category = 'v' then a.lackscore else '9999' end) as decimal(6,2)) as lackscore
       ,cast((case when a.category = 'v' then a.pricescore else '9999' end) as decimal(6,2)) as pricescore
       ,cast((case when a.category = 'v' then a.totalscore else '9999' end) as decimal(6,2)) as totalscore
       ,customer_name = case @lang
       when 'sc' then b.nameSc
       when 'tc' then b.nameTc
       else nameEn
       end
       ,LTRIM(RTRIM(c.drdl01)) as city_name
       from tbl_wf_MKT_VisitRecord a
       left join tbl_wf_MKT_Customer b on b.customerId = a.customerId
       left join tbl_pl_raw_catDesc c on LTRIM(RTRIM(c.DRKY)) = LTRIM(RTRIM(a.cityId))
       where a.state='D' and LTRIM(RTRIM(a.cityId)) in (select ss from #temp) and datediff(dd,@start_date,a.visitDate) >=0 and datediff(dd,@end_date,a.visitDate) <=0
union all
       select
       ''
       ,cast((sum(d.dtplscore) * 1.0 / count(d.dtplscore)) as decimal(6,1))
       ,cast((sum(e.dhlscore) * 1.0  / count(e.dhlscore)) as decimal(6,1))
       ,cast((sum(e.disnearleaderscore) * 1.0  / count(e.disnearleaderscore)) as decimal(6,1))
       ,cast((sum(d.ctplscore) * 1.0  / count(d.ctplscore)) as decimal(6,1))
       ,cast((sum(e.chlscore) * 1.0  / count(e.chlscore)) as decimal(6,1))
       ,cast((sum(e.cisnearleaderscore) * 1.0  / count(e.cisnearleaderscore)) as decimal(6,1))
       ,cast((sum(d.lackscore) * 1.0  / count(d.lackscore)) as decimal(6,1))
       ,cast((sum(d.pricescore) * 1.0  / count(d.pricescore)) as decimal(6,1))
       ,cast((sum(d.totalscore) * 1.0  / count(d.totalscore)) as decimal(6,1))
       ,'AVERAGE:'
       ,''
       from tbl_wf_MKT_VisitRecord d
       left join tbl_wf_MKT_VisitRecord e on e.item_id = d.item_id
       where d.state='D' and LTRIM(RTRIM(d.cityId)) in (select ss from #temp) and datediff(dd,@start_date,d.visitDate) >=0 and datediff(dd,@end_date,d.visitDate) <=0 and d.category = 'v'
union all
       select
       f.cityId
       ,cast(((sum(case f.dtplscore when 10 then 1 else 0 end )  * 1.0 / count(f.dtplscore)) * 100) as decimal(6,2))
       ,cast(((sum(case g.dhlscore when 10 then 1 else 0 end )  * 1.0/ count(g.dhlscore))* 100) as decimal(6,2))
       ,cast(((sum(case g.disnearleaderscore when 5 then 1 else 0 end ) * 1.0 / count(g.disnearleaderscore))* 100) as decimal(6,2))
       ,cast(((sum(case f.ctplscore when 10 then 1 else 0 end ) * 1.0 / count(f.ctplscore))* 100) as decimal(6,2))
       ,cast(((sum(case g.chlscore when 10 then 1 else 0 end )  * 1.0/ count(g.chlscore))* 100) as decimal(6,2))
       ,cast(((sum(case g.cisnearleaderscore when 5 then 1 else 0 end ) * 1.0 / count(g.cisnearleaderscore))* 100) as decimal(6,2))
       ,cast(((sum(case f.lackscore when 30 then 1 else 0 end ) * 1.0 / count(f.lackscore))* 100) as decimal(6,2))
       ,cast(((sum(case f.pricescore when 30 then 1 else 0 end ) * 1.0 / count(f.pricescore))* 100) as decimal(6,2))
       ,-1
       ,'PASSING RATE:'
       ,''
       from tbl_wf_MKT_VisitRecord f
       left join tbl_wf_MKT_VisitRecord g on g.item_id = f.item_id
       where f.state='D' and LTRIM(RTRIM(f.cityId)) in (select ss from #temp) and datediff(dd,@start_date,f.visitDate) >=0 and datediff(dd,@end_date,f.visitDate) <=0 and f.category = 'v'
order by 1 desc
END

执行改语句就出错:
Column 'tbl_wf_MKT_VisitRecord.cityId' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

如果把f.cityId改成'',这语句就能执行……


请李老师帮忙看下哪里不对,非常感谢。

aspx 于 2009, December 7, 3:43 PM 发表该评论

身份证号码验证-支持新的带x身份证

身份证号码验证建议使用正则表达式来做,就好比最后一位是由0、1、X构成。在正则里面直接写成[01X]即可。
   正则表达式的语意上更简练,复杂的字符验证最好用正则。

邓麟 于 2009, December 2, 10:06 AM 发表该评论

ASP.NET 读取数字证书中的用户名称

好明白了,我再试试,我转你文章去我博客

路人甲 于 2009, July 15, 9:41 PM 发表该评论

ASP.NET 读取数字证书中的用户名称

IIS肯定要设定的,在站点属性的“目录安全性”里面的“安全通信”设置要接受或者必须证书访问,才能调用到本地证书,不然直接进网站了。

Calchas 于 2009, July 15, 8:40 PM 发表该评论

ASP.NET 读取数字证书中的用户名称

这个isPresent 一直为false。
能否详细说明下,是否是因为需要设置IIS,才能获取到。
还没有能理解,客户段会不会有多个证书,
这个是获取的什么证书呢?

路人甲 于 2009, July 15, 3:11 PM 发表该评论

动易后台模板:未将对象引用设置到对象的实例

如果是自己编写的代码,则可能是CS文件中的控件名称与ASPX页面代码中的控件名称不一致导致的。检查CS文件中是否有ASPX页面并不存在的控件名称。

Calchas 于 2009, July 13, 11:16 AM 发表该评论

获取 FormView 编辑模板中的控件

FormView 控件的名称

Calchas 于 2009, July 10, 1:07 PM 发表该评论

获取 FormView 编辑模板中的控件

我想请问你
TextBox txtMajor=(TextBox)fvPlanInfo.FindContro("txtMajor);
这句代码中fvPlanInfo是什么呀。急。谢谢。

齐海燕 于 2009, July 10, 8:57 AM 发表该评论

ASP+SQL问题讨论专用

老师你开发项目的时候,Sql server用到过外键吗?

asp.net 于 2009, May 18, 9:12 AM 发表该评论

ASP+SQL问题讨论专用

DataNavigateUrlFormatString="picview.aspx?id={0}&amp;sortvalue={1}&amp;select="&b
vb 应该是这样的吧

Calchas 于 2009, May 6, 5:31 PM 发表该评论

ASP+SQL问题讨论专用

DataNavigateUrlFormatString="picview.aspx?id={0}&amp;sortvalue={1}"

如何在后面加.vb里的变量 用

picview.aspx?id={0}&amp;sortvalue={1}?&amp;select=<%'"+b+"'%>

b =1
没有效果

asp.net 于 2009, April 29, 12:22 PM 发表该评论

ASP+SQL问题讨论专用

引用 Calchas 说过的话:
我测试了都是正常的啊、


ie的bug

上传jpg图像的类型获取是image/pjpg

asp.net 于 2009, April 29, 12:20 PM 发表该评论

ASP+SQL问题讨论专用

我测试了都是正常的啊、

Calchas 于 2009, April 23, 1:00 PM 发表该评论

ASP+SQL问题讨论专用

pictype1 = picupload.PostedFile.ContentType

                If pictype1 <> "image/jpg" And pictype1 <> "image/jpeg" And pictype1 <> "image/gif" And pictype1 <> "image/png" And pictype1 <> "image/tiff" And pictype1 <> "application/x-jpg" Then
                    response.write("不是图片文件")

end if

用这个判断,我上传jpg和png图片都提示不是图片文件,唯独只能上传gif文件……不知道为什么。

asp.net 于 2009, April 22, 5:26 PM 发表该评论

PHP读MSSQL日期问题

If you are having problems with truncated text fields from mssql queries (pe. at 4096 characters), try some of the following:

in php.ini:
- mssql.textlimit = 65536
- mssql.textsize = 65536

in your php code, before your queries:
- mssql_query ( 'SET TEXTSIZE 65536' , $myConn );
- ini_set ( 'mssql.textlimit' , '65536' );
- ini_set ( 'mssql.textsize' , '65536' );

Calchas 于 2009, April 3, 4:34 PM 发表该评论

解决gridview没有数据时不显示任何内容

好方法,谢谢!

魔方网 于 2009, April 3, 12:06 PM 发表该评论

php5 无法连接 mssql2005

MSSQL2000 不存在这个问题

Calchas 于 2009, March 31, 3:04 PM 发表该评论

CS0115: “*.GetTypeHashCode() 没有找到适合的方法来重写

太谢谢了 我的那个错 就是你说的

qidian144 于 2009, March 30, 10:50 PM 发表该评论

ASP+SQL问题讨论专用

fromappid 确认下这个字段是否存在,属性是什么

Calchas 于 2009, March 24, 11:16 PM 发表该评论

Records:28912345678910»