PC Review


Reply
Thread Tools Rate Thread

convert Microsoft .NET Pet Shop 3.0 into vb.net problem

 
 
=?Utf-8?B?Q2hyeXNhbg==?=
Guest
Posts: n/a
 
      25th Oct 2005
I have download the Enterprise Sample(Microsoft .Net Pet Shop 3.0, which
source code is written in CSharp) from the web, and try to convert it into
VB.Net code.

I have done with the 'IDAL' and 'Model' projects, and now is working on
'DALFactory' project. I have add a 'IDAL' reference in the 'DALFactory'
project. But, when I write the 'Public Shared Function Create() As
PetShop.IDAL.IAccount'.
I get the error msg "Type 'PetShop.IDAL.IAccount' is not defined."

Why is this happen?

Thanks.


Following is my Account.vb code in project 'DALFactory'
----------------------------------------------------------------
Imports System
Imports System.Reflection
Imports System.Configuration

Namespace PetShop.DALFactory

' <summary>
' Factory implementaion for the Account DAL object
' </summary>
Public Class Account
Public Shared Function Create() As PetShop.IDAL.IAccount
'/ Look up the DAL implementation we should be using
Dim path As String =
System.Configuration.ConfigurationSettings.AppSettings("WebDAL")
Dim className As String = path + ".Account"

' Using the evidence given in the config file load the
appropriate assembly and class
ReturnCType(Assembly.Load(path).CreateInstance(className),
PetShop.IDAL.IAccount)
End Function
End Class
End Namespace


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hyeXNhbg==?=
Guest
Posts: n/a
 
      25th Oct 2005
Problem solved, after I remove the 'Root namespace' of project 'DALFactory'.

sorry.

"Chrysan" wrote:

> I have download the Enterprise Sample(Microsoft .Net Pet Shop 3.0, which
> source code is written in CSharp) from the web, and try to convert it into
> VB.Net code.
>
> I have done with the 'IDAL' and 'Model' projects, and now is working on
> 'DALFactory' project. I have add a 'IDAL' reference in the 'DALFactory'
> project. But, when I write the 'Public Shared Function Create() As
> PetShop.IDAL.IAccount'.
> I get the error msg "Type 'PetShop.IDAL.IAccount' is not defined."
>
> Why is this happen?
>
> Thanks.
>
>
> Following is my Account.vb code in project 'DALFactory'
> ----------------------------------------------------------------
> Imports System
> Imports System.Reflection
> Imports System.Configuration
>
> Namespace PetShop.DALFactory
>
> ' <summary>
> ' Factory implementaion for the Account DAL object
> ' </summary>
> Public Class Account
> Public Shared Function Create() As PetShop.IDAL.IAccount
> '/ Look up the DAL implementation we should be using
> Dim path As String =
> System.Configuration.ConfigurationSettings.AppSettings("WebDAL")
> Dim className As String = path + ".Account"
>
> ' Using the evidence given in the config file load the
> appropriate assembly and class
> ReturnCType(Assembly.Load(path).CreateInstance(className),
> PetShop.IDAL.IAccount)
> End Function
> End Class
> End Namespace
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
microsoft shop with kids aid program andrew harwood Microsoft Word New Users 1 17th Jun 2009 02:17 PM
how can i make a shop for my website in microsoft frontpage 2003? =?Utf-8?B?bWF0dA==?= Microsoft Frontpage 4 27th Jul 2006 07:02 PM
Microsoft .Net Pet Shop 4 =?Utf-8?B?dGhlV2l6YXJkMQ==?= Microsoft ADO .NET 0 18th Mar 2006 07:47 PM
Print Shop/Microsoft Word Clip Art Cat Windows XP General 0 5th Apr 2004 01:19 AM
.Microsoft .net Pet Shop Startup Problems Chris Windows XP Setup 1 6th Jan 2004 12:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:04 AM.