p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio (http://p2p.wrox.com/forumdisplay.php?f=477)
-   -   Error CS0508 - Chapter 6 (http://p2p.wrox.com/showthread.php?t=77108)

Gilbo79 November 20th, 2009 12:23 PM

Error CS0508 - Chapter 6
 
Hi,

I have made it through to Chapter 6 a little scarred but still plodding on. I get the above error when compiling and it relates to ErrorPage.aspx.cs and states that in line 31 'ErrorPage.CapabilityNames()': return type must be 'string[]' to match overridden member 'BasePage.CapabilityNames()'

If I remove the [] after string on line 51 of BasePage.cs, public abstract string[] CapabilityNames();

I get that it cannot convert type 'char' to 'string'

All the other projects build ok it;s just the UI I am having issues with at the moment.

Help greatly received...I must finsih this book/framework soon.

Gilbo

Corsair November 20th, 2009 04:48 PM

Take a look at what the method code is returning - it should be returning a string [], otherwise you'll continue to get errors compiling.

In other words, if your method code ends with return xyz, and xyz is anything other than a string [], it won't work. As the compiler said, it has to be string [] to match the method it's overriding.
Tim


All times are GMT -4. The time now is 01:27 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.