locked
how to display value '01' into datatable RRS feed

  • Question

  • Hi all:

    how to display or save value like '01' into datatable?

    if i store 01 in to datarow and add to datatable, only 1 shows.

    thanks for help.

    Robin

    Tuesday, April 20, 2010 1:50 AM

Answers

  • What is the type of the database field?

    If its numeric then it will not show leading 0s. To store leading 0 it has to be char or similar.


    Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.
    Tuesday, April 20, 2010 11:18 AM

All replies

  • try....

    Public Shared Function Format(ByVal provider As

    System.IFormatProvider, ByVal format As String, ByVal ParamArray args As Object( )) As String

    Member of

    System.String

    Summary:

    Replaces the format item in a specified string with the string representation of a corresponding object in a specified array. A specified parameter supplies culture-specific formatting information.

    Parameters:

    provider

    : An object that supplies culture-specific formatting information.

    format

    : A composite format string.

    args

    : An object array that contains zero or more objects to format.

    Return Values:

    A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args.

    Exceptions:

    System.ArgumentNullException

    : format or args is null.

    System.FormatException

    : format is invalid.-or- The index of a format item is less than zero, or greater than or equal to the length of the args array.

    Attributes:

    <System.Security.SecuritySafeCriticalAttribute>

    Tuesday, April 20, 2010 3:16 AM
  • What is the type of the database field?

    If its numeric then it will not show leading 0s. To store leading 0 it has to be char or similar.


    Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.
    Tuesday, April 20, 2010 11:18 AM