by1455的自留地

  博客园 :: 首页 :: 联系 :: 订阅 订阅 :: 管理
  146 Posts :: 0 Stories :: 96 Comments :: 2 Trackbacks

公告

昵称:by1455
园龄:4年7个月
粉丝:2
关注:0

搜索

 
 

常用链接

我的标签

最新评论

阅读排行榜

评论排行榜

推荐排行榜

2011年9月29日 #

输出

bcp "SELECT * FROM 库名.表名" queryout 表名.dat -c -S 服务器名 -T

 

输入

bcp 库名.表名 in 表名.dat -T -c

posted @ 2011-09-29 12:01 by1455 阅读(12) 评论(0) 编辑

2011年9月22日 #

在主程序中用以下javascript

 

 function calcIFrameHeight(id) {
           
          //find the height of the internal page
          var theHeight=
            document.getElementById(id).contentWindow.
              document.body.scrollHeight;
 
          //change the height of the iframe
          document.getElementById(id).height =
              theHeight + 50;
        }

 

在iframe中用

if (this.frameElement != null) window.parent.calcIFrameHeight(this.frameElement.attributes.id.value);

 

 

posted @ 2011-09-22 10:26 by1455 阅读(11) 评论(0) 编辑

2011年8月15日 #

一直使用以下的SQL

 

 

SET NOCOUNT ON

 

-- Table row counts and sizes.

CREATE TABLE #t

(

    [name] NVARCHAR(128),

    [rows] CHAR(11),

    reserved VARCHAR(18),

    data VARCHAR(18),

    index_size VARCHAR(18),

    unused VARCHAR(18)

)

 

INSERT #t EXEC sp_msForEachTable 'EXEC sp_spaceused ''?'''

 

-- Order by size (need to remove the KB sign).

SELECT *

FROM   #t ORDER by cast(SUBSTRING(reserved, 1, LEN(reserved)-2) as Int) desc

 

DROP TABLE #t

 

 

但是今天碰到table名中含有schemas,就看上去怪怪的,

只好改用下面的SQL,还来不及检查发生了什么事,只好头痛医头脚痛医脚

 

declare @RowCount int, @tablename varchar(100)

 

declare @Tables table (

 

PK int IDENTITY(1,1),

 

tablename varchar(100),

 

processed bit

 

)

 

INSERT into @Tables (tablename)

 

SELECT '['+SCHEMA_NAME(schema_id)+'].['+name+']' AS TableName

 

FROM sys.tables order by TABLENAME asc

 

declare @Space table (

 

[id] [int] IDENTITY(1,1) NOT NULL,

 

name varchar(100), rows nvarchar(100), reserved varchar(100), data char(100), index_size varchar(100), unused varchar(100)

)

 

 

select top 1 @tablename = tablename from @Tables where processed is null

 

SET @RowCount = 1

 

WHILE (@RowCount <> 0)

 

BEGIN

print @tablename

 

insert into @Space exec sp_spaceused @tablename

 

update @Space set name = @tablename where id = (select top 1 MAX(id) as no from @Space)

 

 

update @Tables set processed = 1 where tablename = @tablename

 

select top 1 @tablename = tablename from @Tables where processed is null

 

SET @RowCount = @@RowCount

 

 

END

update @Space set data = replace(data, 'KB', '')

 

update @Space set data = cast(data as decimal(10,0)) / 1000

 

update @Space set data = cast(data as decimal(10,2))

 

update @Space set reserved = replace(reserved, 'KB', '')

 

update @Space set reserved = cast(reserved as decimal(10,0)) / 1000

 

update @Space set reserved = cast(reserved as decimal(10,2))

 

 

 

select name as Tablename, rows, replace(data,' ','') + 'MB' as used, replace(reserved,' ','') + 'MB' as [Reserved] ,index_size,unused from @Space order by convert(decimal(10,2),data) desc

 

 

 

posted @ 2011-08-15 14:24 by1455 阅读(74) 评论(0) 编辑

2011年2月14日 #

在iis5/ii6时代,通过iis manager 导入/导出Site的配置非常容易,

在iis7,这个东东被和谐了,好在下面的命令行可以完成同样工作

 

导出Site的配置

 %windir%\system32\inetsrv\AppCmd.exe LIST SITE "Old Site" /config /XML > site.xml

导入Site的配置

%windir%\system32\inetsrv\AppCmd.exe ADD SITE /IN < site.xml

 

posted @ 2011-02-14 15:54 by1455 阅读(123) 评论(0) 编辑

2010年11月3日 #

从网上拷贝,方便记忆

Keyboard Shortcuts

1. Alt-Shift-Enter to View Coding Window Full-screen

clip_image001clip_image003clip_image004clip_image003[1]clip_image005

Hitting "Alt+Shift+Enter" will make the coding window full-screen and (temporarily) drop most other windows from view. Restore to your usual window configuration by de-pressing the "Full Screen" button at top (the fact that it seems to be pushed up a little off-screen must be a VS2010 Beta 2 deal):

clip_image007

2. Alt-F12 to Find Symbol

clip_image001[1]clip_image003[2]clip_image008

Use "Alt-F12" to find symbols, objects, or members.

clip_image010

3. Ctrl-F to do a Quick Find

clip_image011clip_image003[3]clip_image012

Search for something in the current code file quickly with "Ctrl-f". clip_image014

4. Ctrl-Shift-F to Find in Files

clip_image011[1]clip_image003[4]clip_image004[1]clip_image003[5]clip_image012[1]

Find in files is easy with "Ctrl-Shift-f". clip_image016

5. Ctrl-K-C to Comment/Uncomment Code

clip_image011[2]clip_image003[6]clip_image012[2]clip_image003[7]clip_image017

You can comment or uncomment code by highlighting the respective code block and hitting "Ctrl-k-c" to comment or "Ctrl-k-u" to uncomment. This shortcut even works in .aspx pages.

clip_image019

clip_image021

6. Ctrl-K-D to Reformat the Entire Document

clip_image011[3]clip_image003[8]clip_image022clip_image003[9]clip_image023

If you want to reformat all of the code in the current document, hit "Ctrl-k-d".

7. Ctrl-K-F to Reformat a Block of Code

clip_image011[4]clip_image003[10]clip_image022[1]clip_image003[11]clip_image012[3]

If you've just pasted in a bunch of code where the formatting is screwed-up, just highlight it and hit "Ctrl-k-f" to format.

8. Ctrl-K-L to Toggle Outlining Ctrl-M-M to Toggle Outlining

clip_image011[5]clip_image003[12] clip_image024 clip_image003[13] clip_image024[1]

If you want to open (expand) or close (collapse) all outlining in a code file, use "Ctrl-m-m". It works like a toggle, alternatively expanding or collapsing all outlining in the current file.

9. Ctrl-K-S to Access Code Snippets

clip_image011[6]clip_image003[14]clip_image022[2]clip_image003[15]clip_image025

Easily open the code snippets selection dropdown with "Ctrl-k-s":

clip_image027

10. Ctrl–K–T to View Call Hierarchy

clip_image011[7]clip_image003[16]clip_image022[3]clip_image003[17]clip_image028

Highlight a member operation and hit "Ctrl-k-t" to view it's call hierarchy.

clip_image030

A new window will open:

clip_image032

11. Ctrl-L to Cut Line to Clipboard

clip_image011[8]clip_image003[18]clip_image033

It's not necessary to highlight an entire line and then hit the delete key. Just hit "Ctrl-L" and the line the cursor is currently on will be removed and copied to the clipboard. "Ctrl-x" performs the same operation by default.

12. Ctrl-F3 to Search Without the Dialog

clip_image011[9]clip_image003[19]clip_image034

clip_image011[10]clip_image003[20]clip_image004[2]clip_image003[21]clip_image034[1]

Just highlight the text you want to search on and hit "Ctrl-F3" to search down or "Ctrl-Shift-F3" to search up.

13. Ctrl-, (Ctrl-Comma) to Perform a Fuzzy 'Navigate To' Search

clip_image011[11]clip_image003[22]clip_image036

Perform a "fuzzy" search and get location information with "Ctrl-," (Ctrl-Comma).

clip_image038

14. Ctrl-] to Find Matching Curly Brace or Region

clip_image011[12]clip_image003[23]clip_image039

Position the cursor next to a curly brace ('{' or '}') and hit "Ctrl-}'. This will toggle the cursor between the matching braces.

clip_image041

This shortcut will also work for #region...#endregion's.

15. F9 to Add/Remove Breakpoint

clip_image042

'F9' will toggle breakpoints for the current line.

16. F12 to Go to Definition

clip_image008[1]

Put the cursor on an item and hit 'F12'. Instant 'go to definition' functionality.

17. Shift-F5 to Stop Debugging

clip_image004[3]clip_image003[24]clip_image043

To stop debugging a project, use "Shift-F5". Much quicker than going through the Debug menu.

18. Shift-F12 to Find Usages

clip_image004[4]clip_image003[25]clip_image008[2]

'Shift-F12' will find all usages of the item the cursor is currently on and display the "Find Usages" dialog (this is ReSharper's version of the dialog; standard VS2008 looks a little different):

clip_image045

19. 'prop' to Create New Property

clip_image047clip_image003[26]clip_image048clip_image003[27]clip_image048[1]

Add a new property in code by typing prop then hitting the Tab key twice. This "prop-TAB-TAB" combination will create a property template that looks like:

1: public int MyProperty { get; set; }

View Plain

Mouse Shortcuts

1. Right-click to add references

Say you've just entered a line of code like the following where the red squiggly indicates you haven't yet added the necessary reference (in VS2010 Beta 2, the red squiggly isn't showing up, but the shortcut still works):

clip_image050

You could jump to the top of the file and type it in manually, or you could right-click on the squiggly-indicated word and choose "Resolve | using …":

clip_image052

This will add the needed reference for you, no typing required.

2. Zoom In/Zoom Out

clip_image011[13]clip_image003[28]clip_image054

The same Word functionality of pressing Ctrl and zooming in and out is now in VS2010.

3. Remove unused references

Many times there are references included in the "using…" section that are not needed. Removing the unnecessary ones is easy: Right-click anywhere on the code file, select "Organize Usings | Remove Unused Usings".

clip_image056

4. Sort usings

To sort your "usings…" section, right-click anywhere on the code file and select "Organize Usings | Sort Usings".

clip_image058

5. Open a file's "containing folder"

Right-click on an open file's tab, select "Open Containing Folder".

clip_image060

6. Copy a file's folder location to the clipboard

Right-click on an open file's tab, select "Copy Full Path".

clip_image062

7. Close all files but "this" one

If you have more than one file open, you can right-click on one of the file tabs (the one which you want to stay open) and choose "Close All But This". This will close all other files.

clip_image064

8. Close tab

A quick way of closing a tab is to use the mouse scroll or middle button. Hover the mouse cursor over the tab, click the mouse scroll button, and the file (and it's tab) will close.

9. Highlight References/Usages

Place the cursor on any member and VS2010 will auto-highlight it throughout:

clip_image066

posted @ 2010-11-03 16:33 by1455 阅读(202) 评论(0) 编辑

2010年10月11日 #

摘要: http://www.cshost.members.winisp.net/blog/vstsresources.html阅读全文
posted @ 2010-10-11 16:06 by1455 阅读(47) 评论(0) 编辑

2010年10月4日 #

摘要: 这几天在为一个房地产软件安装一个Windows 2008 x64 虚拟机环境。OS均是从一个标准的模板拷贝出来, 结果在重启以后失去Gateway IP。找了半天在vmware kb上发现了答案 http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=...阅读全文
posted @ 2010-10-04 17:27 by1455 阅读(54) 评论(0) 编辑

2010年8月31日 #

摘要: 有时侯需要批量拷贝一些文件到sharepoint 2010的档案库,sharepoint feature solution 可以简单的完成 例如要把 hi.docx,sample.txt 拷贝到 hiweb.contoso.com 和 intranet.contoso.com 下的 shared documents. 如下步骤: 在 SPS2010 的系统路径的 features 下 新开一...阅读全文
posted @ 2010-08-31 11:36 by1455 阅读(54) 评论(0) 编辑

2010年8月18日 #

摘要: http://www.iheartmacros.com/ 相当不错。阅读全文
posted @ 2010-08-18 15:19 by1455 阅读(51) 评论(0) 编辑

摘要: https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032456699&CountryCode=US阅读全文
posted @ 2010-08-18 15:14 by1455 阅读(56) 评论(0) 编辑