Archive for July, 2009


BlogEngine.NET Widget: Quote of the Day

I love quotes.

SQL Where语句后加上1=1的具体作用

问题:Where语句后加上一个 1=1 是什么意思?

解答:where后面总要有语句,加上了1=1后就可以保证语法不会出错!

假如后面确定有条件语句,就可以不用1=1;

不能确定where后面是否有语句的时候就要加上1=1了,当没有其他条件语句时候,还有1=1,就不会输错了 。

例子:

SQL=”SELECT * FROM TABLE WHERE 1=1 “&WHERE_STR

WHERE_STR是根据前面填入的得到的一个串.这样就不用管是否为空,都不会出现错误。

SQL Server 2005新功能-TSQL

SQL Server 2005相对于SQL Server 2000改进很大,有些还是非常实用的。

举几个例子来简单说明 这些例子我引用了Northwind库。

1. TOP 表达式
SQL Server 2000的TOP是个固定值,是不是觉得不爽,现在改进了。

–前n名的订单
declare @n int

SQL SERVER 2005 同步复制技术

以下实现复制步骤(以快照复制为例)
运行平台SQL SERVER 2005

一、准备工作:
1.建立一个 WINDOWS 用户,设置为管理员权限,并设置密码,作为发布快照文件的有效访问用户。

2.在SQL SERVER下实现发布服务器和订阅服务器的通信正常(即可以互访)。打开1433端口,在防火墙中设特例

3.在发布服务器上建立一个共享目录,作为发布快照文件的存放目录。例如:在D盘根目录下建文件夹名为SqlCopy

4.设置SQL 代理(发布服务器和订阅服务器均设置)

打开服务(控制面板—管理工具—服务)
—右击SQLSERVER AGENT—属性—登录—选择“此帐户“
—输入或选择第一步中创建的WINDOWS 用户
—“密码“中输入该用户密码

5.设置SQL SERVER 身份验证,解决连接时的权限问题(发布、订阅服务器均设置)

步骤为:对象资源管理器—-右击SQL实例—–属性—-安全性—-服务器身份验证——选“SQL Server和WINDOWS“,然后点确定

6.开启SQL Server 2005的网络协议TCP/IP和管道命名协议并重启网络服务。

What is SmartDRV and Download

Click here to Download: SMARTDRV.zip (13.68 kb)

Godaddy空间Access数据库中文乱码问题

非程序生成的文字可以显示。但程序生成的文字就只有E文可以显示了。中文全是?号,这是数据库乱码引起的
那么解决方法可以考虑如下:

方法一:
使用 Microsoft Access 2000 打开数据库,选择工具菜单>数据库实用工具>转换数据库>到早期 Access 数据库版本。OK!

方法二:

添加<%@ CODEPAGE = "936" %>到每一页的开头,有点类似于jsp中的
<%@ page c%>

例子如下面所示:
<%@ CODEPAGE = "936" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.ADO" %>
<%@ Import Namespace="System.Globalization" %>



方法三:(此方法针对MSSQL库的乱码)

添加一个web.config文件到
web目录下,
建立一个文件web.config,内容如下,放在WEB目录下


4. 如果是MSSQL 数据库,插入字符时乱码

解决方法就是在要插入的中文字符的引号前加N

比如一般情况下
insert into theme(name,about)

How to show classic asp error details on GoDaddy IIS7

I also use GoDaddy and have been going crazy because everything would work on my test server but then break once uploaded. I finally got the web.config to work and here it is.

Either add this to your existing web.config, or create a new one. I have it in the directory of files I am troubleshooting. Not sure if it makes a difference:






The following article explains the setting about ASP error message, for your reference:
Classic ASP script error messages are no longer shown in a Web browser by default
Classic ASP script error messages are no longer shown in a Web browser by default (http://learn.iis.net/page.aspx/564/classic-asp-script-error-messages-are-no-longer-shown-in-a-web-browser-by-default/)

Pagination Gallery: Examples And Good Practices

Structure and hierarchy reduce complexity and improve readability. The more organized your articles or web-sites are, the easier it is for users to follow your arguments and get the message you are trying to deliver. On the Web this can be done in a variety of ways.

In body copy headlines and enumerations are usually used to present the information as logically separated data chunks. An alternative solution is pagination, a mechanism which provides users with additional navigation options for browsing through single parts of the given article. Parts of the article are usually referred to by numbers, hints, arrows as well as “previous” and “next”-buttons.

Search engines almost always use pagination; newspapers tend to make use of it for navigation through the parts of rather large articles. And there are situations when pagination is also necessary for weblogs. Additional navigation can simplify the access to some site pages — e.g. make it easier for users to browse through the archives of the site.

In most cases pagination is better than traditional “previous – next” navigation as it offers visitors a more quick and convenient navigation through the site. It’s not a must, but a useful nice-to-have-feature.

Let’s take a look at the good practices of pagination design as well as some examples of when and how the pagination is usually implemented.

Good Practices Of Pagination Design
(7 Aspects according to Faruk Ates)

  1. Provide large clickable areas
  2. Don’t use underlines
  3. Identify the current page
  4. Space out page links
  5. Provide Previous and Next links
  6. Use First and Last links (where applicable)
  7. Put First and Last links on the outside

Related References

  • An ultimate article about pagination, Pagination 101, has already been written by Faruk Ates.
  • Style sheets freely available for free download: Some Styles For Your Pagination.
  • If your weblog runs upon WordPress you can use WP-PageNavi plug-in to generate pagination “on the fly”. It’s easy to install, however, requires some changes in the source code of your WordPress theme.

Mistake #1: Navigation Options Are Invisible

Since pagination’s primary purpose is to serve as an improved navigation, it is supposed to make it clear for the visitors where they are, where they’ve already been and where they can go next. These three facts give users a complete understanding of how the system works and how the navigation should be used.

But most importantly, the navigation options should be visible. Hugg.com doesn’t follow this guideline. The color of the links has a very low contrast with the white background. The hover-effect isn’t provided.

Screenshot Pagination
The color of the links on Hugg.com has a very low contrast with the white background. The hover-effect isn’t provided.

Mistake #2: Pagination Isn’t Intuitive

If you have to decide between a quite complex (but beautiful) pagination and a simple one with necessary functionality always prefer the simple solution. If users don’t understand the mechanism behind navigation they won’t be able to use it and therefore won’t use your web-site.

Helium.com is a perfect example for this mistake. Take a look at the screenshot below: what do the arrows stand for? For the page you’ve already visited or for the page you are currently on? And why does the link to the second page have a white background color? Why do the arrows have different colors? This is unintuitive.

Screenshot Pagination
Unintuitive pagination design on Helium.com

Unintuitive designs result from the lack of structure, hierarchy and well thought-out design decisions. “Blank” pagination is as unintuitive as overcrowded design solution.

Screenshot Pagination
Our favourite example: Helium.com

Screenshot Pagination
Not spaced out page links are harder to scan and to navigate through. Make-Believe.org as an example. The design is unintuitive.

Creative Solutions Can Be User-Friendly

The more frequently a design element is used, the harder it is for designers to introduce some creative approaches without risking to make the design less intuitive. Consequently, pagination designs have rather a variety of different patterns — revolutionary approaches are used very rarely.

However, creative approaches can be user-friendly. E.g. Dirty.ru uses a slider-based pagination menu; users can drag it to get more available options, that means links to the older pages of the site.

Screenshot Pagination
A slider on Dirty.ru

Erweiterungen.de, the German version of the official Firefox extensions web-site, provides more navigation options once the visitor clicks on the “…”-button.

Screenshot Pagination
Further navigation options are displayed once the “…”-button is clicked. Erweiterungen.de.

Gallery

Although “standard” pagination — linked blue numbers following each other — is very common for most web interfaces, designers tend to experiment with colors, forms, backgrounds and shapes.

The pagination doesn’t need to look nice aiming to captivate users’ attention; as a part of site navigation it offers users an important functionality and as such has to be used effectively. Still, visual clues can be helpful. In most designs blue and grey colors dominate — colors traditionally used by services.

Simple Enumeration

Facebook

Screenshot Pagination

Businessweek

Slanted

Cpluv

Stylegala

Screenshot Pagination

Overture

Misal

Colors and Shapes In Use

Often designers use colors to highlight the current page and separate it from the other pages. The numbers of the pages are also given a shape: a rectangle, a circle or a button. The current page is usually not linked.

StylishLabs

Apple Store

Bildblog

Screenshot Pagination

Sitepoint

Amazon

Maple

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Flickr

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

UXMag

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Designshack

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Screenshot Pagination

Pagination With Manual Page Input

In some cases users can provide the number of the page they’d like to see manually, via the input-element. This is common for paginations with the limited number of options — e.g. in these designs you can’t jump to the last page if you’d like to.

Screenshot Pagination

Veer

Screenshot Pagination

Unusual Solutions

Screenshot Pagination

Screenshot Pagination

What is the equivalent to regsvr32 in .NET?

Where you once used Regsvr32 on unmanaged COM libraries, you will now use Regasm on managed .NET libraries.

Regsvr32 is

Does C# support variable arguments (vararg’s) on methods?

There was a suggestion/question on the Product Feedback site for VS2005 that suggested that the params keyword may not be that well understood.

The params keyword can be applied on a method parameter that is an array.

Powered by WordPress | Theme: Motion by 85ideas.