accessing columns default value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Greenwood

    #1

    accessing columns default value

    How do I get a columns default value into a type dataset in C#?? I see a
    method for setting
    columns to null but default values must be easier to get to than it seems.



  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: accessing columns default value

    Tim,

    It actually isn't. You can't get the default value in a
    provider-agnostic way, because there is no infrastructure yet to access the
    table schema through ADO.NET. You can get it through ADOX (a COM object)
    most likely, but there is not a completely managed solution to this.

    Of course, if you are using just one database solution and the provider
    supports it, or you can query the server for it, then you can do that.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Tim Greenwood" <tim_greenwood@ yahoo.com> wrote in message
    news:%23a7Uys8S DHA.1552@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > How do I get a columns default value into a type dataset in C#?? I see a
    > method for setting
    > columns to null but default values must be easier to get to than it seems.
    >
    >
    >[/color]


    Comment

    Working...