accessing columns default value

T

Tim Greenwood

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top