Home All Groups Group Topic Archive Search About

SqlDataReader.GetChar(n) failed because of Specified method unsupp

Author
28 Jan 2005 9:47 PM
DHuang

Hi there,

I just set up my VStudio 2003 and tried to run a test of reading a character
from database by using SqlDataReader.GetChar, but it failed. I got the
following error message: -----------------------------------------------------------------------------------------------
An unhandled exception of type 'System.NotSupportedException' occurred in
system.data.dll

Additional information: Specified method is not supported. -----------------------------------------------------------------------------------------------
The real value in the table is 'N'.

Any one knows what happened? I am new to .Net. Is my system.data.dll too old?


I checked the dll file located at
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and its version is 1.1.4322.2032.

Thanks for your help.

Daniel Huang

Author
28 Jan 2005 11:10 PM
Sahil Malik
GetChar is not supported on SqlDataReader, it is present only because
IDataReader forces you to implement it.

I know the MSDN documentation doesn't say so .. but methinks this is true
:-/

As a matter of fact, VS2005, doesn't even show it in intellisense, but the
code compiles just fine. WEIRD !! Anyway .. now u know why ..
- Sahil Malik
http://codebetter.com/blogs/sahil.malik/






Show quoteHide quote
"DHuang" <DHu***@discussions.microsoft.com> wrote in message
news:DFA43DB2-CBFC-4D6C-9836-01FA8522A8C0@microsoft.com...
> Hi there,
>
> I just set up my VStudio 2003 and tried to run a test of reading a
character
> from database by using SqlDataReader.GetChar, but it failed. I got the
> following error message:
> --------------------------------------------------------------------------
---------------------
> An unhandled exception of type 'System.NotSupportedException' occurred in
> system.data.dll
>
> Additional information: Specified method is not supported.
> --------------------------------------------------------------------------
---------------------
> The real value in the table is 'N'.
>
> Any one knows what happened? I am new to .Net. Is my system.data.dll too
old?
>
>
> I checked the dll file located at
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and its version is
1.1.4322.2032.
Show quoteHide quote
>
> Thanks for your help.
>
> Daniel Huang
>
>
Are all your drivers up to date? click for free checkup

Author
28 Jan 2005 11:27 PM
Sahil Malik
BTW, I checked the reflected code.
More details are here.

http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48887.aspx


- Sahil Malik
http://codebetter.com/blogs/sahil.malik/



Show quoteHide quote
"Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
news:Ogqtg6YBFHA.3416@TK2MSFTNGP09.phx.gbl...
> GetChar is not supported on SqlDataReader, it is present only because
> IDataReader forces you to implement it.
>
> I know the MSDN documentation doesn't say so .. but methinks this is true
> :-/
>
> As a matter of fact, VS2005, doesn't even show it in intellisense, but the
> code compiles just fine. WEIRD !! Anyway .. now u know why ..
> - Sahil Malik
> http://codebetter.com/blogs/sahil.malik/
>
>
>
>
>
>
> "DHuang" <DHu***@discussions.microsoft.com> wrote in message
> news:DFA43DB2-CBFC-4D6C-9836-01FA8522A8C0@microsoft.com...
> > Hi there,
> >
> > I just set up my VStudio 2003 and tried to run a test of reading a
> character
> > from database by using SqlDataReader.GetChar, but it failed. I got the
> > following error message:
>
> --------------------------------------------------------------------------
> ---------------------
> > An unhandled exception of type 'System.NotSupportedException' occurred
in
> > system.data.dll
> >
> > Additional information: Specified method is not supported.
>
> --------------------------------------------------------------------------
> ---------------------
> > The real value in the table is 'N'.
> >
> > Any one knows what happened? I am new to .Net. Is my system.data.dll too
> old?
> >
> >
> > I checked the dll file located at
> > C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and its version is
> 1.1.4322.2032.
> >
> > Thanks for your help.
> >
> > Daniel Huang
> >
> >
>
>
Author
29 Jan 2005 4:55 AM
DHuang
Thanks.

I realized that that method is not implemented but just throws a
System.NotSupportedException. The VStudio does not provide this method when I
coded it. The MSDN library misled me because it does not state so.  And
VStudio Arthitect 2003 (the verios I am using) is not smart enough to warn me
this unimplemented method.

Daniel Huang

Show quoteHide quote
"Sahil Malik" wrote:

> BTW, I checked the reflected code.
> More details are here.
>
> http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48887.aspx
>
>
> - Sahil Malik
> http://codebetter.com/blogs/sahil.malik/
>
>
>
> "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
> news:Ogqtg6YBFHA.3416@TK2MSFTNGP09.phx.gbl...
> > GetChar is not supported on SqlDataReader, it is present only because
> > IDataReader forces you to implement it.
> >
> > I know the MSDN documentation doesn't say so .. but methinks this is true
> > :-/
> >
> > As a matter of fact, VS2005, doesn't even show it in intellisense, but the
> > code compiles just fine. WEIRD !! Anyway .. now u know why ..
> > - Sahil Malik
> > http://codebetter.com/blogs/sahil.malik/
> >
> >
> >
> >
> >
> >
> > "DHuang" <DHu***@discussions.microsoft.com> wrote in message
> > news:DFA43DB2-CBFC-4D6C-9836-01FA8522A8C0@microsoft.com...
> > > Hi there,
> > >
> > > I just set up my VStudio 2003 and tried to run a test of reading a
> > character
> > > from database by using SqlDataReader.GetChar, but it failed. I got the
> > > following error message:
> >
> > --------------------------------------------------------------------------
> > ---------------------
> > > An unhandled exception of type 'System.NotSupportedException' occurred
> in
> > > system.data.dll
> > >
> > > Additional information: Specified method is not supported.
> >
> > --------------------------------------------------------------------------
> > ---------------------
> > > The real value in the table is 'N'.
> > >
> > > Any one knows what happened? I am new to .Net. Is my system.data.dll too
> > old?
> > >
> > >
> > > I checked the dll file located at
> > > C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and its version is
> > 1.1.4322.2032.
> > >
> > > Thanks for your help.
> > >
> > > Daniel Huang
> > >
> > >
> >
> >
>
>
>
Author
29 Jan 2005 4:59 AM
DHuang
Do you know if there is another method (way) to retrieve the a value from a
single character column or I have to use GetString?

Thanks again.

Daniel Huang

Show quoteHide quote
"DHuang" wrote:

> Thanks.
>
> I realized that that method is not implemented but just throws a
> System.NotSupportedException. The VStudio does not provide this method when I
> coded it. The MSDN library misled me because it does not state so.  And
> VStudio Arthitect 2003 (the verios I am using) is not smart enough to warn me
> this unimplemented method.
>
> Daniel Huang
>
> "Sahil Malik" wrote:
>
> > BTW, I checked the reflected code.
> > More details are here.
> >
> > http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48887.aspx
> >
> >
> > - Sahil Malik
> > http://codebetter.com/blogs/sahil.malik/
> >
> >
> >
> > "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
> > news:Ogqtg6YBFHA.3416@TK2MSFTNGP09.phx.gbl...
> > > GetChar is not supported on SqlDataReader, it is present only because
> > > IDataReader forces you to implement it.
> > >
> > > I know the MSDN documentation doesn't say so .. but methinks this is true
> > > :-/
> > >
> > > As a matter of fact, VS2005, doesn't even show it in intellisense, but the
> > > code compiles just fine. WEIRD !! Anyway .. now u know why ..
> > > - Sahil Malik
> > > http://codebetter.com/blogs/sahil.malik/
> > >
> > >
> > >
> > >
> > >
> > >
> > > "DHuang" <DHu***@discussions.microsoft.com> wrote in message
> > > news:DFA43DB2-CBFC-4D6C-9836-01FA8522A8C0@microsoft.com...
> > > > Hi there,
> > > >
> > > > I just set up my VStudio 2003 and tried to run a test of reading a
> > > character
> > > > from database by using SqlDataReader.GetChar, but it failed. I got the
> > > > following error message:
> > >
> > > --------------------------------------------------------------------------
> > > ---------------------
> > > > An unhandled exception of type 'System.NotSupportedException' occurred
> > in
> > > > system.data.dll
> > > >
> > > > Additional information: Specified method is not supported.
> > >
> > > --------------------------------------------------------------------------
> > > ---------------------
> > > > The real value in the table is 'N'.
> > > >
> > > > Any one knows what happened? I am new to .Net. Is my system.data.dll too
> > > old?
> > > >
> > > >
> > > > I checked the dll file located at
> > > > C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and its version is
> > > 1.1.4322.2032.
> > > >
> > > > Thanks for your help.
> > > >
> > > > Daniel Huang
> > > >
> > > >
> > >
> > >
> >
> >
> >
Author
29 Jan 2005 5:16 AM
Sahil Malik
I think it's GetString()

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik


Show quoteHide quote
"DHuang" <DHu***@discussions.microsoft.com> wrote in message
news:106FE312-B5DA-4DAF-BBD1-A5AEB661BC34@microsoft.com...
> Do you know if there is another method (way) to retrieve the a value from
> a
> single character column or I have to use GetString?
>
> Thanks again.
>
> Daniel Huang
>
> "DHuang" wrote:
>
>> Thanks.
>>
>> I realized that that method is not implemented but just throws a
>> System.NotSupportedException. The VStudio does not provide this method
>> when I
>> coded it. The MSDN library misled me because it does not state so.  And
>> VStudio Arthitect 2003 (the verios I am using) is not smart enough to
>> warn me
>> this unimplemented method.
>>
>> Daniel Huang
>>
>> "Sahil Malik" wrote:
>>
>> > BTW, I checked the reflected code.
>> > More details are here.
>> >
>> > http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48887.aspx
>> >
>> >
>> > - Sahil Malik
>> > http://codebetter.com/blogs/sahil.malik/
>> >
>> >
>> >
>> > "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
>> > news:Ogqtg6YBFHA.3416@TK2MSFTNGP09.phx.gbl...
>> > > GetChar is not supported on SqlDataReader, it is present only because
>> > > IDataReader forces you to implement it.
>> > >
>> > > I know the MSDN documentation doesn't say so .. but methinks this is
>> > > true
>> > > :-/
>> > >
>> > > As a matter of fact, VS2005, doesn't even show it in intellisense,
>> > > but the
>> > > code compiles just fine. WEIRD !! Anyway .. now u know why ..
>> > > - Sahil Malik
>> > > http://codebetter.com/blogs/sahil.malik/
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > "DHuang" <DHu***@discussions.microsoft.com> wrote in message
>> > > news:DFA43DB2-CBFC-4D6C-9836-01FA8522A8C0@microsoft.com...
>> > > > Hi there,
>> > > >
>> > > > I just set up my VStudio 2003 and tried to run a test of reading a
>> > > character
>> > > > from database by using SqlDataReader.GetChar, but it failed. I got
>> > > > the
>> > > > following error message:
>> > >
>> > > --------------------------------------------------------------------------
>> > > ---------------------
>> > > > An unhandled exception of type 'System.NotSupportedException'
>> > > > occurred
>> > in
>> > > > system.data.dll
>> > > >
>> > > > Additional information: Specified method is not supported.
>> > >
>> > > --------------------------------------------------------------------------
>> > > ---------------------
>> > > > The real value in the table is 'N'.
>> > > >
>> > > > Any one knows what happened? I am new to .Net. Is my
>> > > > system.data.dll too
>> > > old?
>> > > >
>> > > >
>> > > > I checked the dll file located at
>> > > > C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and its version is
>> > > 1.1.4322.2032.
>> > > >
>> > > > Thanks for your help.
>> > > >
>> > > > Daniel Huang
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>> >

Bookmark and Share