p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 (http://p2p.wrox.com/forumdisplay.php?f=409)
-   -   Ch14;get Class not register error with Code Example (http://p2p.wrox.com/showthread.php?t=74697)

clay5050 June 7th, 2009 04:25 PM

Ch14;get Class not register error with Code Example
 
hi all, I just want to say the book is great. my previous programming experience is writing about a dozen powershell scripts but this book has really exposed me to alot of different things.

I got a question that has stumped me. Im using Visual Studio 2008 and I loaded the example project Ch14CreateDatabase (I've made no changes to the original program). This is the example mentioned in Ch 14, Page 406 about creating a database. I'm stepping through the program to watch the process flow and see what gets assigned to the variables. Inside of the program, if I click "File --> New", take the deafult DB name or enter a new name, I get a "Error: Class not register". I debug the program and step through and it generates the exception in the file clsDB.cs, Line 85. Here is a snippet of the code (Line 85 is myCat.Create(newDB))
Code:

ADOX.CatalogClass myCat = new ADOX.CatalogClass();
newDB = CONNECTSTRING + combinedName +
";" + CONNECTSTRINGPART2;
myCat.Create(newDB);
myCat =
null;

my gut tells me the project is not setup properly but not sure what to do. any ideas?

DrPurdum June 10th, 2009 09:49 AM

Database issue
 
While I can't be positive, my guess is that the problem arises because you didn't add a reference to the ADOX routines. Read the material on page 406 and see if the issue doesn't go away.

clay5050 June 11th, 2009 07:09 PM

Try it out
 
Hi there, I tried adding the reference Microsoft ADO Ext. 2.8 for DLL and Security (in the book, page 406) but that didn't help...got the same error.

that is OK, i'm going to move on

Ceromus July 30th, 2009 06:05 PM

This error happens straight from the downloaded sample code. I'm not sure what the cause of the issue is.

Ceromus July 31st, 2009 06:40 AM

Found it: http://social.msdn.microsoft.com/For...0-538bc21d3544

djhmateer December 23rd, 2009 07:17 AM

Hi

I'm on 32bit (it looks like Ceromus is on 64).. and I had intellisense weirdness after adding the reference. I've also got Resharper which may have been the cause. Anyway, a quick restart of VS2008 made everything sing and dance again.


All times are GMT -4. The time now is 09:11 PM.

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