|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SqlDataReader.GetChar(n) failed because of Specified method unsuppI 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 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 thecode 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 1.1.4322.2032.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 Show quoteHide quote > > Thanks for your help. > > Daniel Huang > > 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 > > > > > > 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 > > > > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > 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 >> > > > >> > > > >> > > >> > > >> > >> > >> >
Data reader already open?
Question about SQLDataReader OleDbParameter doesn't update value correctly # of pooled connections seem too high What is the Best way to fetch the most recent updated row in a database Question on how I can use ForeignKeyConstraint Cant get Stored Procedure connection string right?? Dataset created in Code cannot be used in Crystal Reports designer RowState Confused about MissingSchemaAction.AddWithKey |
|||||||||||||||||||||||