Results 1 to 4 of 4

Thread: Usar SQL tabelas em outro computador (Use SQL tables on another computer)

  1. #1

    Thread Starter
    Registered User DFoxAO's Avatar
    Join Date
    Dec 2017

    Exclamation Usar SQL tabelas em outro computador (Use SQL tables on another computer)

    Boa tarde companheiros,
    (vou usar a lingua portuguesa, porque sou nativo nela)

    A minha questão é a seguinte:
    Criei uma aplicação com o MVS 2012 e usei SQL 2012 também. Chegado ao fim e realizado a compilação e criado o instalador, a referida não transporta as tabelas de SQL.
    Como resolver esta situação?

    Best regards

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Bristol, UK

    Re: Usar SQL tabelas em outro computador

    Welcome to VBForums

    Quote Originally Posted by automatic translation
    Good afternoon, fellows,
    (I'm going to use the Portuguese language because I'm native to it)

    My question is this:
    I created an application with MVS 2012 and I used SQL 2012 as well. Come to the end and performed the compilation and created the installer, the referred does not carry the SQL tables.
    How to solve this situation?

    Best regards
    This is an English speaking site, please post only in English.

    I know it might not be easy for you, but you will get more help that way... and you can use automatic translation tools (like Google translate).

  3. #3
    PowerPoster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Columbus, Ohio

    Re: Usar SQL tabelas em outro computador (Use SQL tables on another computer)

    Here is an example:
    Attached Images Attached Images  
    Please remember next time...elections matter!

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: Usar SQL tabelas em outro computador (Use SQL tables on another computer)

    There are two main ways to make use of a SQL Server database in VB.NET. The most common way, and previously the only way, was to create an always-attached database on a SQL Server instance. That would usually be done in SQL Server Management Studio. In your application, the connection string would contain a Data Source attribute to specify the instance and an Initial Catalog attribute to specify the database.

    More recently, Microsoft has provided the ability to add a SQL Server data file (.mdf extension) directly to your project and have that attached to an instance on demand. In that case, your connection string would contain a Data Source and also an AttachDbFilename attribute to specify the path of the file to be attached.

    In the first case, the SQL Server instance can be on a network server and multiple users can connect to the same database. In the second case, each user must have SQL Server Express installed on their local machine and each user will have their own local database.

    So, we need to know which of these two mechanisms you're trying to use and also exactly how you created the installer. If you are going with the always-attached option then having the database as part of your application installation wouldn't make sense if multiple users will access the same database. If it is just one user then you could include the database in the installer. Your two choices would be a database backup that you could restore or one or more SQL scripts that you could execute. If you're going with the on-demand option then you just need to include the MDF file with your EXE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width