星宿.net

星星的随笔

博客园 首页 新随笔 联系 订阅 管理
  31 Posts :: 0 Stories :: 235 Comments :: 16 Trackbacks

2007年11月28日 #

记得弄这个的时候折腾了好久,就因为这个错误:
刚刚有人问,也写出来记一下..
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ssosrv 
ImagePath的路径把引号去掉C:\Program Files\Common Files\Microsoft Shared\Microsoft Single Sign-on\SSOSRV.EXE
重启SSO服务
posted @ 2007-11-28 15:16 星宿.NET 阅读(418) | 评论 (0)编辑

2007年9月28日 #

从SQL SERVER 2000中备份的数据库还原到SQL SERVER 2005上,打算新建一个数据库关系图,可是在Microsoft SQL Server Management Studio中一点数据库关系图的文件夹,就出现一个“此数据库没有有效所有者,因此无法安装数据库关系图支持对象。若要继续,请首先试用"数据库属性"对话框的"文件"页或ALTER AUTHORIZATION语句将数据库所有者设置为有效登录名,然后再添加数据库关系图支持对象”的提示
按照他说的指定所有者,可惜还是不对,查了一下,应该执行如下语句:
USE [master]
GO
EXEC dbo.sp_dbcmptlevel @dbname=N'数据库名', @new_cmptlevel=90
GO

因为2000备份的数据库还原到2005以后,兼容级别是80,更新成90就OK了
posted @ 2007-09-28 14:02 星宿.NET 阅读(766) | 评论 (3)编辑

2007年9月26日 #

--建立连接服务器
EXEC sp_addlinkedserver
--要创建的链接服务器名称 
'DMZLINK',
--产品名称        
'MS',
--OLE DB 字符
'SQLOLEDB',
--数据源
'192.168.0.68'

EXEC sp_addlinkedsrvlogin
'DMZLINK',
'false',
NULL,
--远程服务器的登陆用户名
'sa',
--远程服务器的登陆密码
'sa'
go

posted @ 2007-09-26 13:27 星宿.NET 阅读(148) | 评论 (0)编辑

2007年8月2日 #

SQL语句进行left join的时候发生Cannot resolve collation conflict for equal to operation.错误
加入database_default就可以了

LEFT JOIN @CorePartTemp cpt on o.Part = cpt.ProductId COLLATE database_default

posted @ 2007-08-02 16:15 星宿.NET 阅读(1203) | 评论 (0)编辑

2007年5月10日 #

   
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.DirectoryServices;

namespace WebAppLDAP
{
    
public partial class _Default : System.Web.UI.Page
    
{
        
protected void Page_Load(object sender, EventArgs e)
        
{
            
//ListAllUser();
            showUser();
        }

        
protected void showUser()
        
{
            DirectoryEntry entry 
= new DirectoryEntry("LDAP://ABC.COM.CN");
            System.DirectoryServices.DirectorySearcher mySearcher 
= new System.DirectoryServices.DirectorySearcher(entry);

            mySearcher.Filter 
= "(&(objectClass=user)(objectCategory=person))";

            mySearcher.PropertiesToLoad.Add(
"name"); //用户名
            mySearcher.PropertiesToLoad.Add("samaccountname"); //用户帐号

            SearchResultCollection resultCol 
= mySearcher.FindAll();

            
foreach (SearchResult result in resultCol)
            
{
                ResultPropertyCollection props 
= result.Properties;

                
foreach (string propName in props.PropertyNames)
                
{
                    
//Response.Write(props[propName][0] + "<BR>");
                    if (propName == "name")
                    
{
                        Response.Write(props[propName][
0+ "<BR>");
                    }

                    
if (propName == "samaccountname")
                    
{
                        Response.Write(props[propName][
0+ "<BR><BR>");
                    }

                }

            }

        }

    }

}

posted @ 2007-05-10 16:12 星宿.NET 阅读(249) | 评论 (1)编辑