Re: Default values in dataTable



Thanks alot!!!!
I don't know why I didn't try that.


"Darren Shaffer" <darrenshaffer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:#2hRU7QyFHA.2228@xxxxxxxxxxxxxxxxxxxxxxx
> if ( dtr.IsDBNull(2) )
> retVal = string.empty
> else
> retVal = dtr.GetString(2)
>
> --
> Darren Shaffer
> .NET Compact Framework MVP
> Principal Architect
> Connected Innovation
> www.connectedinnovation.com
>
>
>
> "Vladimir O¾ura" <vladimir.ozura@xxxxxx> wrote in message
> news:dhud06$aov$1@xxxxxxxxxxxxxxxx
> >I am building a Pocket PC application in C# and I tryed to get the
Default
> > values of columns in a given table with the following SqlCeCommand:
> >
> > SqlCeCommand columns = new SqlCeCommand(@"SELECT COLUMN_NAME, TYPE_NAME,
> > COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS,
> > INFORMATION_SCHEMA.PROVIDER_TYPES WHERE
> >
INFORMATION_SCHEMA.COLUMNS.DATA_TYPE=INFORMATION_SCHEMA.PROVIDER_TYPES.DATA_
> > TYPE AND TYPE_NAME NOT IN
> > ('ntext','nchar','image','binary','varbinary','uniqueidentifier') AND
> > COLUMN_NAME NOT IN ('s_Generation') AND TABLE_NAME = ?", this.sqlce);
> >
> > When I Execute the command and try to read the COLUMN_DEFAULT "String"
> > with
> > the following command:
> >
> > dtr.GetString(2);
> >
> > I get an SqlNullValueException. I know that the default value in the
> > database is set to NULL, but can't you read a NULL value and then set
the
> > defautl value in a dataTable to NULL?
> >
> > Is there another way to get that COLUMN_DEFAULT without getting the
> > exception?
> >
> > THANKS!!!
> >
> >
>
>


.



Relevant Pages

  • Re: sql ce merge replication
    ... ..NET Compact Framework MVP ... Principal Architect ... Connected Innovation ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: existence of a table
    ... ..NET Compact Framework MVP ... Principal Architect ... Connected Innovation ...
    (microsoft.public.sqlserver.ce)
  • Re: dataset sql2000 sqlce
    ... >> Darren Shaffer ... >> .NET Compact Framework MVP ... >> Principal Architect ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to detect which ListView item user clicks?
    ... Darren Shaffer .NET Compact Framework MVP ... Connected Innovation www.connectedinnovation.com ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Problem with CF2.0 and form.show
    ... >> ..NET Compact Framework MVP ... >> Principal Architect ... >> Connected Innovation ...
    (microsoft.public.dotnet.framework.compactframework)