摘要: --SQL CODE TO CREATE SPCreate procedure usp_ImportMultipleFiles2 @filepath nvarchar(500), @pattern nvarchar(100)asset quoted_identifier off-- Set query files under folder declare @sql nvarchar(1000)set @sql ='master.dbo.xp_cmdshell "dir '+@filepath+@pattern +' /b"'--Retriev 阅读全文
posted @ 2012-05-04 21:15 mjg 阅读(327) 评论(0) 推荐(0) 编辑
摘要: --go--create function fn_split(@str nvarchar(4000), @delimiter nvarchar(1))--returns @tempData table (slice nvarchar(4000))--as--begin--declare @index int --declare @slice nvarchar(4000)--if LEN(@str)<1 or @str is null return--set @index=charindex(@delimiter,@str)--while(@index<>0)--begin-- 阅读全文
posted @ 2012-04-27 21:43 mjg 阅读(274) 评论(0) 推荐(0) 编辑
摘要: declare @country xml set @country =( select * from openrowset(bulk 'D:\TEMP\country_iso.xml',single_clob) as xmldata)insert XMLData (RawXml) values(@country ) 阅读全文
posted @ 2012-04-27 19:53 mjg 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Cross Apply ,nodes ,xpath 阅读全文
posted @ 2012-04-27 19:45 mjg 阅读(338) 评论(0) 推荐(0) 编辑
摘要: silveright 5.0 搜索代码生成系统 阅读全文
posted @ 2011-08-21 20:57 mjg 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 问题: Products={{ID=1,Name=ProductName_1},{ID=2,Name=ProductName_2},......,{ID=n,Name=ProductName_n}}, Orders ={{ID=1,ProductID=ProductID_1,CustomerName=CustomerName_1},......,{ID=m,ProductID=ProductID_m,CustomerName=CustomerName_m}} 怎样产生 ProductSummary={{ProductName=ProductName1 , Customs="Custo 阅读全文
posted @ 2011-07-22 14:22 mjg 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 1.问题:最近手上有个项目,需要用到wpf, wpf没有silverlight的childwindow, 这样弹窗口不是很方便2.解决办法:整合了一下网上意见,得到解决办法如下: public static class ChildWindowBehaviorRegist { public static void Show(this FrameworkElement control) { Grid grid = GetRootGrid(control ); RootAndMask ram = GetRootAndMask(control); if (grid != null && 阅读全文
posted @ 2011-07-01 10:13 mjg 阅读(1630) 评论(5) 推荐(1) 编辑
摘要: 客户要求所有childwindow支持 Key.Enter,Key.Escape 代替click ok/cancel btn. 用下面的方法能快速完成public class HotKeyManager { public static void RegistKeyEventHandler(UIElement control, RoutedEventHandler okHanlder, RoutedEventHandler cancelHanlder) { control.KeyDown += (s, e) => { if (e.Key == Key.Escape) { cancelHan 阅读全文
posted @ 2011-06-29 14:43 mjg 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 项目中需要在新的浏览器上显示产品快照(不是childwindow). 客户希望添加一个按钮自动关闭浏览器,不用点击浏览器上的 X。 使用下面的代码工作private void closeBtn_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Eval("window.open('','_self');window.close();"); } 阅读全文
posted @ 2011-06-28 16:22 mjg 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 项目中需要把silverlight page转化为pdf,html. pdf 已经工作,html有个bug, 当页面中有中文时会出现乱码。string html = GetHtml(card, properties, propertyColumns, labels, labelColumns, enforcements, enforcementColumns, listings, listingColumns, products, productColumns, aliases, aliasColumns); Stream s = fsd.OpenFile(); byte[] data = S 阅读全文
posted @ 2011-06-23 14:31 mjg 阅读(566) 评论(0) 推荐(0) 编辑