in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

June 2008 - Posts

  • /define (Preprocessor Definition) (C# Compiler Options)

    The /define option defines name as a symbol in your program.

    /define:name[;name2]

    Collapse imageArguments

    name, name2

    The name of one or more symbols that you want to define.

    Collapse imageRemarks

    The /define option has the same effect as using a #define preprocessor directive in your source file. A symbol remains defined until an #undef directive in the source file removes the definition or the compiler reaches the end of the file.

    You can use symbols created by this option with #if, #else, #elif, and #endif to compile source files conditionally.

    /d is the short form of /define.

    You can define multiple symbols with /define by using a semicolon or comma to separate symbol names. For example:

     
    /define:DEBUG;TUESDAY

    The C# compiler itself defines no symbols or macros that you can use in your source code; all symbol definitions must be user-defined.

    NoteNote:

    The C# #define does not allow a symbol to be given a value, as in languages such as C++. For example, #define cannot be used to create a macro or to define a constant. If you need to define a constant, use an enum variable. If you want to create a C++ style macro, consider alternatives such as generics. Since macros are notoriously error-prone, C# disallows their use but provides safer alternatives.

    To set this compiler option in the Visual Studio development environment

    1. Open the project's Properties page.

    2. Modify the Conditional Compilation Symbols property.

    For information on how to set this compiler option programmatically, see DefineConstants.

    Collapse imageExample

      Copy imageCopy Code
    // preprocessor_define.cs
    // compile with: /define:xx
    // or uncomment the next line
    // #define xx
    using System;
    public class Test 
    {
        public static void Main() 
        {
            #if (xx) 
                Console.WriteLine("xx defined");
            #else
                Console.WriteLine("xx not defined");
            #endif
        }
    }

    Collapse imageSee Also

    Posted Jun 28 2008, 03:31 PM by wicky with no comments
    Filed under:
  • Element Type of CLR

    et_unknown 

    Undefined type.
    et_void  ELEMENT_TYPE_VOID.
    et_boolean  ELEMENT_TYPE_BOOLEAN, System.Boolean.
    et_char  ELEMENT_TYPE_CHAR, System.Char.
    et_int8  ELEMENT_TYPE_I1, System.SByte.
    et_uint8  ELEMENT_TYPE_U1, System.Byte.
    et_int16  ELEMENT_TYPE_I2, System.Short.
    et_uint16  ELEMENT_TYPE_U2, System.UShort.
    et_int32  ELEMENT_TYPE_I4, System.Int.
    et_uint32  ELEMENT_TYPE_U4, System.UInt.
    et_int64  ELEMENT_TYPE_I8, System.Long.
    et_uint64  ELEMENT_TYPE_U8, System.ULong.
    et_float32  ELEMENT_TYPE_R4, System.Float.
    et_float64  ELEMENT_TYPE_R8, System.Double.
    et_string  ELEMENT_TYPE_STRING, System.String.
    et_ptr  ELEMENT_TYPE_PTR, pointer to type.
    et_byref  ELEMENT_TYPE_BYREF, reference to type.
    et_valuetype  ELEMENT_TYPE_VALUETYPE, struct.
    et_class  ELEMENT_TYPE_CLASS, class.
    et_array  ELEMENT_TYPE_ARRAY, array of type.
    et_genericinst  ELEMENT_GENERICINST, type instance.
    et_typedbyref  ELEMENT_TYPE_TYPEDBYREF, System.Type.
    et_intptr  ELEMENT_TYPE_I, System.IntPtr.
    et_uintptr  ELEMENT_TYPE_U, System.UintPtr.
    et_fnptr  ELEMENT_TYPE_FNPTR, pointer to method.
    et_object  ELEMENT_TYPE_OBJECT, System.Object.
    et_decimal  System.Decimal.
    et_enum  enum (value type derived from System.Enum)
    et_generic_param  Generic parameter (ELEMENT_TYPE_VAR, ELEMENT_TYPE_MVAR).
    et_literal_null  Special type for null literal.
    et_arglist  Special type for __arglist.
    et_anonymous_method  Anonymous Method.
    et_error  Used for catch erroneous operators (for internal purposes only).

     

  • Oracle忘记System和Sys密码怎么办?

    oracle提供两种验证方式,一种是OS验证,另一种密码文件验证方式,如果是第一种方式用以下方法修改密码:
    sqlplus /nolog;
    connect / as sysdba
    alter user sys identified by ;
    alter user system identified by ;

    如果是第二种方法用以下方法修改密码:
    orapwd file=pwdxxx.ora password=你设定的新密码 entries=10
    设定完后,重新启动服务,再次登陆就可以了。

    Posted Jun 16 2008, 10:26 AM by wicky with no comments
    Filed under:
  • SQL Server中自动编号的方法

    第一种:使用identity函数增加临时表的方法
    select id = identity(int,1,1),* into #tmp from table
    select * from #tmp
    drop table #tmp

    在SQL2005中新增了ROW_NUMBER()函数,给我们带来了很多方便,使用方法如下:
    SELECT id,ROW_NUMBER() OVER (order by id)as RowNumber FROM Table
    有一个方便,as后的别名可以在语句后面作为条件单独使用.
    Posted Jun 13 2008, 02:15 PM by wicky with no comments
    Filed under:
  • Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta

    http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx

    Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 continues Microsoft's investment in market-leading development tools and platform. Service Pack 1 addresses issues that were found through a combination of customer and partner feedback, as well as internal testing. Overall, Service Pack 1 offers customers many new features and improvements in responsiveness, stability and performance for Visual Studio 2008 and .NET Framework 3.5.

    Overview

    With Service Pack 1, Visual Studio 2008 introduces a large assortment of new features for targeting Windows, Office, and the Web. Developers building .NET-basedapplications will enjoy improved performance in the WPF designer, new components for Visual Basic and Visual C++, as well as an MFC-based Office 2007 Ribbon. Web developers will see continued improvement in the client-side script tooling including JavaScript IntelliSense. Additionally, full support for SQL Server 2008, the ADO.NET Entity Framework and performance improvements for the IDE make Service Pack 1 a great release across the board.

    The .NET Framework 3.5 Service Pack 1 delivers more controls, a streamlined setup, improved start-up performance, and powerful new graphics features for client development and rich data scaffolding, improved AJAX support, and other improvements for Web development. Additionally it introduces the ADO.NET Entity Framework and ADO.NET Data Services, which simplify data access code in applications by providing an extensible, conceptual model for data from any data source and enabling this model to closely reflect business requirements.

    Visual Studio 2008 Service Pack 1 includes:

    • Improved designers for building WPF applications
    • Full support for SQL Server 2008
    • The introduction of the ADO.NET Entity Designer
    • Visual Basic and Visual C++ components and tools (including an MFC-based Office 2007 style 'Ribbon')
    • Improvements to Team Foundation Server to respond to customer feedback on version control usability and performance, improved e-mail integration with work item tracking and full support for hosting on SQL Server 2008
    • Improvements for Web development including richer JavaScript support, enhanced AJAX and data tools, and Web site deployment

    The .NET Framework 3.5 Service Pack 1 includes:

    • Performance increases between 20-45% for WPF-based applications - without having to change any code
    • WCF improvements that give developers more control over the way they access data and services
    • Streamlined installation experience for client applications
    • Improvements in the area of data platform, such as the ADO.NET Entity Framework, ADO.NET Data Services and support for SQL Server 2008's new features.

    Additional Details

    In addition, Service Pack 1 for the .NET Framework and Visual Studio 2008 includes a number of new features:

    • Windows Presentation Foundation (WPF) and Visual Designer Changes
    • .NET Framework 3.5 Client Profile
    • New ADO.NET Data Features
    • Team Foundation Server Improvements

    Windows Presentation Foundation (WPF) and Visual Designer Changes

    • Cold startup performance improvement ranging between 20-45% depending on application size without needing to modify any code.
    • Additional WPF features for text, graphics, and media to deliver better performance. For example, effects like DropShadow and Blur were implemented using software rendering; with Service Pack 1 these are now implemented using hardware acceleration. Other examples include:
      • Text, especially when used in Visual and DrawingBrush, is substantially faster.
      • Data scalability improvements - Container Recycling, TreeView virtualization, and more to enable richer data editing support
      • Media performance improvements
      • A much improved WriteableBitmap that enables real-time bitmap updates from a software surface
    • Visual Studio 2008 introduced a brand new designer for WPF applications. Since Visual Studio 2008 released many additional features have become available for inclusion in the designers. These include event tab support within the property grid for control events, toolbox support within source mode, and a variety of other common asks and improvements.

    Windows Communication Foundation (WCF) and Workflow Foundation (WF) Changes

    • New Hosting Wizard for WCF Service projects.
    • Enhancements in Test Client such as support for RM Sessions, Message Contract and Nullable<T> types enables testing of broader set of WCF-based services.
    • Expanding reach of DataContract Serializer by relaxing the need of having [DataContract]/ [DataMember] on types and by supporting an interoperable mechanism for dealing with object references.
    • Improved Partial Trust Debugging Experience with support for Event Log.
    • Support for ADO.NET Entity Framework entities in WCF contracts.
    • Improvements in writing REST based services ranging from easily supporting ServiceDocuments publication and consumption to providing greater control and usability of UriTemplate.
    • Significant performance improvements on large workflow-based projects in Visual Studio.
    • Considerable scalability increases for hosted WCF services in IIS7-integrated mode.

    .NET Framework 3.5 Optimized Client Runtime

    .NET Framework 3.5 SP1 provides an install version of the .NET Framework optimized for client development. The expected final size of this optimized runtime is less than 20 MB.

    New ADO.NET Data Features

    .NET Framework 3.5 SP1 includes two new frameworks, the ADO.NET Entity Framework and ADO.NET Data Services framework, to provide developers with greater flexibility and options when creating applications that access and use data.

    ADO.NET Entity Framework

    The ADO.NET Entity Framework is the next evolution of ADO.NET, raising the level of abstraction at which programmers work with data, and allowing the database structure or data source to evolve without significant impact to the application code.

    Rather than coding against rows and columns, the ADO.NET Entity Framework allows the definition of a higher-level Entity Data Model over your relational data, and allows developers to then program in terms of this model. Developers get to deal with the data in the shapes that make sense for the application, and those shapes are expressed in a richer vocabulary that includes concepts like inheritance, complex types, and explicit relationships.

    Use LINQ to Entities with the Entity Framework for queries that help create easy to maintain code that retrieves and works with strongly typed data objects or business entities.

    ADO.NET Data Services

    The Microsoft ADO.NET Data Services framework provides a first-class infrastructure for developing the next wave of dynamic internet applications by enabling data to be exposed as REST-based data services that can be consumed by client applications (e.g., ASP.NET, AJAX, and Silverlight) in corporate networks and across the internet. Easily build applications using a comprehensive set of Microsoft .NET libraries and client components, accessing data through uniform URI syntax and using standard HTTP verbs to operate on the resource.

    ADO.NET Data Services provides a framework to build data services for relational data sources, such as Microsoft SQL Server, MySQL, DB2, and Oracle, using the built-in support for the ADO.NET Entity Framework, or for non-relational data sources using the pluggable provider model.

    Team Foundation Server Improvements

    A number of improvements and additional features have been added to Visual Studio Team System 2008 Team Foundation Server including:

    Version Control

    • Simplified the user experience through cleaner "Add to Source Control" dialogs, drag and drop support to the Source Control Explorer and a much easier to use "Workspace" dialog for working folder mappings.
    • Version control now automatically supports non-solution controlled files.
    • Various changes to the Source Control Explorer such as a new checkin date/time display column, local path hyperlink support and en editable source location field.

    Work Item Tracking

    • Microsoft Office 2007 integration is now done using the standard Office "Ribbon" delivering a cleaner and easier to use integration to the different Microsoft Office 2007 products.
    • E-mail integration for work items and links for Team system Web Access to make it easier to use e-mail as part of the development life cycle.

    Visual SourceSafe Migration Tool

    • The migration tool has been dramatically improved through many performance and reliability improvements. In addition Service Pack 1 provides support for the elimination of namespace conflicts, automatic solution rebinding, improves timestamp coherency and increases the amount of migration logging information available.

    Performance and Scalability

    • With Service Pack 1 a large part of the focus was to improve the performance and scalability of Team Foundation Server through changes such as faster synchronization with Active Directory, improved checkin concurrency, a faster way to create source tree branches, online index rebuilding for less maintenance downtime and better support for very large checkin sets.
    • Improvements in the number of projects a server can support that make not only the scalability of the server better but also the client experience when connecting to a server with a large number of projects on it.

    Additional Features

    • Support for using SQL Server 2008 with Team Foundation Server.
    • Team System Web Access provides "live" links to work items and checkin e-mail messages. This improves the customer experience for users who do not use Team Explorer.
    • Scripting support for the creation of Team Projects.

    Related Links

  • DevExpress Announcing the Upcoming AgDataGrid Suite for Silverlight

    http://www.devexpress.com/Products/NET/Components/Silverlight/Grid/

    Available Free-of-Charge without any licensing or royalties from DevExpress

    As the release of Silverlight draws near, DevExpress has invested the engineering resources needed to deliver a feature-rich grid control for Silverlight. Not just a "preview" of what is possible with Silverlight, the AgDataGrid Suite was developed to fully exploit the power and flexibility of the platform and will ship with the following features:

    • Data Grouping against multiple Silverlight Grid columns
    • Data Sorting against multiple Silverlight Grid columns
    • Comprehensive Summary Computation support against multiple Silverlight Grid columns
    • Column Movement
    • Column Resizing
    • Column Auto-Width
    • Row Editing
    • Row Preview (with animation)
    • Template Support (for cell content, cell editing, row preview and headers)
    • Auto Height Support for cells, headers, and totals.
    • Virtual StackPanel Row Container (simply means we are able to handle an unlimited number of rows)
    • Focused Row and Focused Cell
    • Multi-Row Selection
    • Cell Text Wrapping
    • Vertical/Horizontal Lines
    • Multiple column types/editors

    Beyond the features we’ve listed above, the AgDataGrid will ship with the following capabilities:

    • Smart UI Element Management
      AgDataGrid implements a smart loading and re-organization of the grid's inner UI elements to provide smaller control load times and faster data operations.
    • Designed for Future Performance Enhancements
      Silverlight is all about client-side technology...But if client/server interaction will be implemented in future versions, our grid is ready to delegate data processing to the server side and thus boost application performance.
    • Higher-Level abstractions
      With our unique measurement routines you don't have to think in terms of pixels - which you do with the standard Silverlight grid. Just like other advanced controls for older platforms, you simply specify styles and fonts and all element sizes are automatically modified.
    • Full Animation Support
      It's hard to imagine any Silverlight control without compelling animation effects. Though the standard Microsoft Silverlight grid control's architecture doesn't support them, AgDataGrid fully supports animations for group row expansion, preview row display and other operations.
    Posted Jun 10 2008, 03:56 PM by wicky with no comments
    Filed under:
  • SimpleReminder Build 2008.06.19

    SimpleReminder 是一个桌面提醒工具,它可以使用Microsoft Agent、Email、运行外部程序等方法,按分钟、小时、周、月等用户设定的计划进行提醒。

    (深情地...)
    有了她,你就不会忘记订饭...
    有了她,你就不会忘记上传月报...
    有了她,你就不会忘记去喝水...
    有了她,你就不会忘记上厕所...
    有了她,你就不会忘记去吃饭...
    有了她,你就不会忘记下班...
    有了她,你就不会忘记重要的日子...
    有了她,工作的时候还会有乐趣...
    有了她,咩都有了!

    另外,w2\...\ms\vs\Misc\Microsoft.Agent\chars.rar 有几个常用的characters.
    放到 Windows\msagent\chars目录下面就可以用了。
    还有英文的语音引擎,安装了会说话的哦。

    更多信息请参看 http://www.microsoft.com/msagent/

    系统需求:
    Windows XP/2003
    .Net Framework 2.0 or above
    Microsoft Agent (default installed with XP/2003)

    Simple Reminder Screen

  • Updatable subscriptions - No transaction is active

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1461689&SiteID=1

    Question:
    This may be a simple answer, but I was wondering when setting up transactional replication with updatable subscriptions why does this error occur?
    Error:
    The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "REPLLINK " was unable to begin a distributed transaction.
    Changed database context to 'MyDB'.
    OLE DB provider "SQLNCLI" for linked server "REPLLINK" returned message "No transaction is active.". (.Net SqlClient Data Provider)

    I've looked for MSDTC security documents and checked every box in the security dialog and selected the 'No Authentication Required’. MSDTC and SQL Agent are running as NETWORKSERVICE user. I also setup permissions on each individual DCOM Objects for SQL Server. And MSDTC service is running. Both Servers are SQL Server 2005 Standard and Windows 2003 R2.  The publisher is on the same box as the distributor. No domains or trusts setup on either. This error occurs when changing data on the subscriber.

    Answer:
    That's because NETWORKSERVICE is only valid on the local machine.  The SID for that account is invalid on any other machine.  You get this error, because you are trying to authenticate to a machine without having valid Windows credentials.  In order to authenticate across machines, you either have to setup the SQL Server Agent to use an actual account that can be granted access to the publisher (for the case where you specify the agent security context to impersonate the SQL Agent user) or you need to configure the replication agent security to utilize either a Windows credential that has valid access to the publisher or a SQL Server login that has valid access to the publisher.

    Posted Jun 03 2008, 09:33 AM by wicky with no comments
    Filed under:
  • Error: The partner transaction manager has disabled its support for remote/network transactions

    http://www.cnblogs.com/Isabella/articles/504004.html

     Reason:
    Either the Microsoft Distributed Transaction Coordinator (MSDTC) service is not running, or your Renaissance Place(a application) application is installed to more than one server (separate database, application, and/or report servers) running Windows Server 2003. The enhanced security built in to Windows Server 2003 may prevent the MSDTC service from functioning as required. This is generally only an issue if the following are true:

     - Renaissance Place is running on separate application and database servers.
     - One or more of the Renaissance Place servers are running Windows Server 2003.
     - The Renaissance Place servers are part of a domain but do not have an established trust relationship, or the servers are part of a Windows workgroup.

    You may also experience this problem after updating to Windows Server 2003 Service Pack 1. The Service Pack 1 update adds new capabilities for managing DTC and automatically enables RPC security, preventing all distributed transactions in Renaissance Place in certain environments.

    Resolution:

    Windows 2000 Server

    To start the MSDTC service:

    1) Open Computer Management, open Services and Applications, and click on Services on the left side of the screen.
    2) In the list of services on the right, locate Distributed Transaction Coordinator and double-click on it.
    3) Change the Startup Type to Automatic and click on the [Start] button to start the service.
    4) Click on [OK] to accept the changes.

    Windows Server 2003

    To start the MSDTC service:

    1) Open Computer Management, open Services and Applications, and click on Services on the left side of the screen.
    2) In the list of services on the right, locate Distributed Transaction Coordinator and double-click on it.
    3) Change the Startup Type to Automatic and click on the [Start] button to start the service.
    4) Click on [OK] to accept the changes.

    If you have separate database, application, and/or report servers, you will need to ensure the service is started on all Renaissance Place servers.

    If Renaissance Place is running on separate application and database servers, follow these instructions on each of your Renaissance Place servers running Windows Server 2003. First, make sure DTC transactions are supported on all Renaissance Place servers:

    1) Click Start, point to Control Panel, and start the Add or Remove Programs application.
    2) Select Add/Remove Windows Components, select the Application Server component, and click [Details].
    3) If “Enable network DTC access” is checked, skip to the next section of this article. If it is not checked, check this option and click [OK], then click [Next]. You may be prompted to insert your Windows Server 2003 CD-ROM.
    4) Click [Finish] when the install is complete and close the Add or Remove Programs application.

    Next, follow these instructions to disable RPC security .

    On each of your Renaissance Place servers running Windows Server 2003 Service Pack 1:

    1) Click Start -> All Programs -> Administrative Tools -> Component Services.
    2) Open Computers, right-click on My Computer, and choose Properties.
    3) Click on the [MSDTC] tab and click on the [Security Configuration] button.
    4) Under the Transaction Manager Communication section, change the setting to “No Authentication Required” and click [OK].
    5) Confirm [Yes] to stop and restart MS DTC.
    6) Click [OK] to confirm the alert, click [OK] to close My Computer properties, and close Component Services.
    7) Restart the computer.

    If one or more of your Renaissance Place servers are running Windows 2003 WITHOUT Service Pack 1 installed, you must manually disable RPC security using REGEDIT. NOTE: This requires accessing and modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs.

    1) Click Start, click Run, type regedit, and click [OK].
    2) Expand HKEY_LOCAL_MACHINE, then SOFTWARE, then Microsoft.
    3) Right-click on MSDTC, point to New, then select DWORD Value.
    4) Rename the key from the default New Value #1 to TurnOffRpcSecurity.
    5) Double-click the new key and change the value to 1, then click [OK].
    6) Close the Registry Editor and restart the computer.

    You may now resume using Renaissance Place.


    If you have made the appropriate changes to DTC but errors persist, note that DTC also requires that you are able to resolve computer names by way of NetBIOS or DNS. You can test whether or not NetBIOS can resolve the names by using ping and the server name for each of the Renaissance Place servers. The application and reports servers must be able to resolve each other as well as the name of the database server, and the database server must be able to resolve the application and reports servers.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1

    First verify the "Distribute Transaction Coordinator" Service is
    running on both database server computer and client computers
    1.      Go to "Administrative Tools > Services"
    2.      Turn on the "Distribute Transaction Coordinator" Service if it is not running

    If it is running and client application is not on the same computer as
    the database server, on the computer running database server
    1.      Go to "Administrative Tools > Component Services"
    2.      On the left navigation tree, go to "Component Services > Computers
    > My Computer" (you may need to double click and wait as some nodes
    need time to expand)
    3.      Right click on "My Computer", select "Properties"
    4.      Select "MSDTC" tab
    5.      Click "Security Configuration"
    6.      Make sure you check "Network DTC Access", "Allow Remote Client",
    "Allow Inbound/Outbound", "Enable TIP" (Some option may not be
    necessary, have a try to get your configuration)
    7.      The service will restart
    8.      BUT YOU MAY NEED TO REBOOT YOUR SERVER IF IT STILL DOESN'T WORK
    (This is the thing drove me crazy before)

    On your client computer use the same above procedure to open the
    "Security Configuration" setting, make sure you check "Network DTC
    Access", "Allow Inbound/Outbound" option, restart service and computer
    if necessary.

    On you SQL server service manager, click "Service" dropdown, select
    "Distribute Transaction Coordinator", it should be also running on
    your server computer.

    Hope it helps,

    Posted Jun 02 2008, 05:12 PM by wicky with no comments
    Filed under:
Copyright SDT, 2006-2009. All rights reserved.