XML in Csharp code?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ozgur develioglu

    #1

    XML in Csharp code?

    Why do you use XML code in c# code like;
    /// <summary>

    /// Execute a SqlCommand (that returns no resultset) against the database
    specified in the connection string

    /// using the provided parameters

    /// </summary>

    /// <remarks>

    /// e.g.:

    /// int result = ExecuteNonQuery (connString, CommandType.Sto redProcedure,
    "PublishOrders" , new SqlParameter("@ prodid", 24));

    /// </remarks>

    /// <param name="connectio nString">A valid connection string for a
    SqlConnection</param>

    /// <param name="commandTy pe">The CommandType (stored procedure, text,
    etc.)</param>

    /// <param name="commandTe xt">The stored procedure name or T-SQL
    command</param>

    /// <param name="commandPa rameters">An array of SqlParamters used to execute
    the command</param>

    /// <returns>An int representing the number of rows affected by the
    command</returns>

    What do they serve?


  • Jack Meyhoff

    #2
    Re: XML in Csharp code?

    Its for automatic documentating, you can auto generate docuementing for APIs
    and class libraries in various forms by running it thru a style sheet, want
    HTML , not a problem. Its a good thing. Use it.


    "ozgur develioglu" <ozgurdeveliogl u@yahoo.com> wrote in message
    news:uwtx0H$YDH A.1916@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Why do you use XML code in c# code like;
    > /// <summary>
    >
    > /// Execute a SqlCommand (that returns no resultset) against the database
    > specified in the connection string
    >
    > /// using the provided parameters
    >
    > /// </summary>
    >
    > /// <remarks>
    >
    > /// e.g.:
    >
    > /// int result = ExecuteNonQuery (connString, CommandType.Sto redProcedure,
    > "PublishOrders" , new SqlParameter("@ prodid", 24));
    >
    > /// </remarks>
    >
    > /// <param name="connectio nString">A valid connection string for a
    > SqlConnection</param>
    >
    > /// <param name="commandTy pe">The CommandType (stored procedure, text,
    > etc.)</param>
    >
    > /// <param name="commandTe xt">The stored procedure name or T-SQL
    > command</param>
    >
    > /// <param name="commandPa rameters">An array of SqlParamters used to[/color]
    execute[color=blue]
    > the command</param>
    >
    > /// <returns>An int representing the number of rows affected by the
    > command</returns>
    >
    > What do they serve?
    >
    >[/color]


    Comment

    • Wim Hollebrandse

      #3
      Re: XML in Csharp code?

      In addition to what Jack mentioned - check out the free Ndoc utility which
      generates MSDN style documentation based on your C# XML comments.

      You can find it at: http://ndoc.sourceforge.net/

      Cheers,
      Wim Hollebrandse

      --
      Wimdows Components
      ..NET components - professional, robust and affordable.
      Zealand IT Ltd is a UK based IT consultancy and software development company that specialises in bespoke Microsoft .NET solutions including ASP.NET web applications and advanced SOA architectures for public and private sector clients. Please contact us for a free quote.

      --


      "ozgur develioglu" <ozgurdeveliogl u@yahoo.com> wrote in message
      news:uwtx0H$YDH A.1916@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Why do you use XML code in c# code like;
      > /// <summary>
      >
      > /// Execute a SqlCommand (that returns no resultset) against the database
      > specified in the connection string
      >
      > /// using the provided parameters
      >
      > /// </summary>
      >
      > /// <remarks>
      >
      > /// e.g.:
      >
      > /// int result = ExecuteNonQuery (connString, CommandType.Sto redProcedure,
      > "PublishOrders" , new SqlParameter("@ prodid", 24));
      >
      > /// </remarks>
      >
      > /// <param name="connectio nString">A valid connection string for a
      > SqlConnection</param>
      >
      > /// <param name="commandTy pe">The CommandType (stored procedure, text,
      > etc.)</param>
      >
      > /// <param name="commandTe xt">The stored procedure name or T-SQL
      > command</param>
      >
      > /// <param name="commandPa rameters">An array of SqlParamters used to[/color]
      execute[color=blue]
      > the command</param>
      >
      > /// <returns>An int representing the number of rows affected by the
      > command</returns>
      >
      > What do they serve?
      >
      >[/color]


      Comment

      • Noah Coad [MVP & MCP]

        #4
        Re: XML in Csharp code?

        And the most obvious (and quick result) reason...
        The VS.NET IDE shows those commend when you use the class and AutoComplete.

        You've seen documentation when using a class and pressing "." after it, like
        this:
        Console.WriteLi ne(
        Well the IDE will use those XML comments to do the same with your code.

        -Noah Coad
        Microsoft MVP & MCP

        "ozgur develioglu" <ozgurdeveliogl u@yahoo.com> wrote in message
        news:uwtx0H$YDH A.1916@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Why do you use XML code in c# code like;
        > /// <summary>
        >
        > /// Execute a SqlCommand (that returns no resultset) against the database
        > specified in the connection string
        >
        > /// using the provided parameters
        >
        > /// </summary>
        >
        > /// <remarks>
        >
        > /// e.g.:
        >
        > /// int result = ExecuteNonQuery (connString, CommandType.Sto redProcedure,
        > "PublishOrders" , new SqlParameter("@ prodid", 24));
        >
        > /// </remarks>
        >
        > /// <param name="connectio nString">A valid connection string for a
        > SqlConnection</param>
        >
        > /// <param name="commandTy pe">The CommandType (stored procedure, text,
        > etc.)</param>
        >
        > /// <param name="commandTe xt">The stored procedure name or T-SQL
        > command</param>
        >
        > /// <param name="commandPa rameters">An array of SqlParamters used to[/color]
        execute[color=blue]
        > the command</param>
        >
        > /// <returns>An int representing the number of rows affected by the
        > command</returns>
        >
        > What do they serve?
        >
        >[/color]


        Comment

        • Jack Meyhoff

          #5
          Re: XML in Csharp code?

          Its called "intellisen se".


          "Noah Coad [MVP & MCP]" <noah@coad.ne t> wrote in message
          news:#eTgmnAZDH A.2284@TK2MSFTN GP10.phx.gbl...[color=blue]
          > And the most obvious (and quick result) reason...
          > The VS.NET IDE shows those commend when you use the class and[/color]
          AutoComplete.[color=blue]
          >
          > You've seen documentation when using a class and pressing "." after it,[/color]
          like[color=blue]
          > this:
          > Console.WriteLi ne(
          > Well the IDE will use those XML comments to do the same with your code.
          >
          > -Noah Coad
          > Microsoft MVP & MCP
          >
          > "ozgur develioglu" <ozgurdeveliogl u@yahoo.com> wrote in message
          > news:uwtx0H$YDH A.1916@TK2MSFTN GP12.phx.gbl...[color=green]
          > > Why do you use XML code in c# code like;
          > > /// <summary>
          > >
          > > /// Execute a SqlCommand (that returns no resultset) against the[/color][/color]
          database[color=blue][color=green]
          > > specified in the connection string
          > >
          > > /// using the provided parameters
          > >
          > > /// </summary>
          > >
          > > /// <remarks>
          > >
          > > /// e.g.:
          > >
          > > /// int result = ExecuteNonQuery (connString,[/color][/color]
          CommandType.Sto redProcedure,[color=blue][color=green]
          > > "PublishOrders" , new SqlParameter("@ prodid", 24));
          > >
          > > /// </remarks>
          > >
          > > /// <param name="connectio nString">A valid connection string for a
          > > SqlConnection</param>
          > >
          > > /// <param name="commandTy pe">The CommandType (stored procedure, text,
          > > etc.)</param>
          > >
          > > /// <param name="commandTe xt">The stored procedure name or T-SQL
          > > command</param>
          > >
          > > /// <param name="commandPa rameters">An array of SqlParamters used to[/color]
          > execute[color=green]
          > > the command</param>
          > >
          > > /// <returns>An int representing the number of rows affected by the
          > > command</returns>
          > >
          > > What do they serve?
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...