Hi,

Can you tell my why when I execute the code below, fields of the object 'TypeProduction' was not fill with the values of the database. The count is good but field ID and Description was Nothing.

Public Shared Sub Create()
      Dim domainConfiguration As Xtensive.Storage.Configuration.DomainConfiguration
      Dim domain As Xtensive.Storage.Domain
      Dim connectionInfo As Xtensive.Core.ConnectionInfo

      connectionInfo = New Xtensive.Core.ConnectionInfo("sqlserver://MyServer\SQLExpress/MyDatabase")

      domainConfiguration = New Xtensive.Storage.Configuration.DomainConfiguration(connectionInfo)
      domainConfiguration.AutoValidation = False
      domainConfiguration.UpgradeMode = DomainUpgradeMode.Legacy

      domainConfiguration.Types.Register(GetType(TypeProduction).Assembly, GetType(TypeProduction).Namespace)

      domain = domain.Build(domainConfiguration)

      Dim session As Session

      session = session.Open(domain)

      Using session
         Dim types = From p In Query.All(Of TypeProduction)() _
                        Order By p.Description _
                        Select p

         For Each type As TypeProduction In types
            MsgBox(type.Description) [b]<---- Description is nothing here! But the count of 'Types' is good...[/b]
         Next

         Dim transactionScope As TransactionScope

         transactionScope = Transaction.Open(session)

         Using transactionScope
            Dim newType As New TypeProduction

            newType.Description = "Test"

            transactionScope.Complete()
         End Using
      End Using
   End Sub

I have change the server name and database name.

Thank you.

This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by Samuel.

asked Feb 25 '10 at 05:23

Editor's gravatar image

Editor
46137156157

Most likely that's because of viewtopic.php?f=29&t=5781&p=13953#p13953 (see second comment there).

(Feb 25 '10 at 05:23) Alex Yakunin Alex%20Yakunin's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA