Problem With Database Snapshot Connect to VB.NET

db , vb.net Cambodia
  • 13 years ago

    Hey ...wake up pls to read my post now...now is 3:47PM

    the microsoft said that we can do database with snapshot but i can't find any sample

    how to  connect database snapshot with VB.NET.

    i try to find alot of site but don't have anybody known about that.

    i create a project by use Database Snapshot is back end bcoz it run wihout SQL Server and VB.NET is front end.

    i have a big problem i want all of programmers to think about that code  as follow

    +Create Database Snapshot Syntax

    CREATE DATABASE KhmerDictionaryCMB ON
    ( NAME = KhmerDictionary, FILENAME = 'C:\NimolProject\Dictionary Testing\Original DBDictionary\TrueDBKhmerDictionary\KhmerDictionary.CMB'
    ) AS SNAPSHOT OF KhmerDictionary

    +Connect to database snapshot from VB.NET code

    Imports Microsoft.SqlServer.Dts.Runtime

    Public Sub Main()

    Dim Constr$=Dts.connections(“ KhmerDictionary”).connectionstring

    If not Constr.contain(“Initial Catalog= KhmerDictionary”) then

              Dts.taskresult=dts.results.failure

              return

    Endif

    Dts.connections( KhmerDictionary”).connectionstring= Dts.connections(“ KhmerDictionary”).connectionstring.replace((“Initial Catalog= KhmerDictionary”, (“Initial Catalog=KhmerDictionaryCMB”)

    Dts.taskresult=dts.results.Success

    End sub

     

    The code above does not response correctly to have the database snapshot  connect to VB.net

    However ,DTS does not show up in code.

    Please held me to resolve this .

     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Every language has an optimization operator. In C++ that operator is ‘//’”