Visual Studio 2003.net Databases Connection not working

I am using Visual Studio 2003.net and trying to get connected to SQL 2005. Is this even possible to do and if not what is the best way to connect to a database with Visual Basic 2003.net. Before I was able to make a connection with VB 2005 express edition and SQL 2005 express edition but this is seeming to be a “no way hosa” kind of thing.
.


Answer this question

Visual Studio 2003.net Databases Connection not working

  • Thurein

    Anyone Anyone Bueller
  • Marlun


    OK, I'm a little confused. Where is your SQL Server Express running Is it a local installation or is it running on a another machine in the network

  • den2005

    Hi,

    Have you checked in your configuration manager if the protocols are enabled Maybe this is the reason that you are not being able to connect in your sql server. Both of the previous posts are right, the ADO.Net, well in connecting to a database, haven't changed from 2003 - 2005. Please post your code for us to solve this problem easier.

    cheers,

    Paul June A. Domag



  • Pierre Maloka

    Paul P Clement IV wrote:

    Assuming you've installed SQL Server Express 2005 on your development machine you probably want to specify (local) as the Data Source. You could also use <MACHINE_NAME>\SQLEXPRESS.

    Thanks, Paul. I do use <MACHINE_NAME>\SQLEXPRESS when I type in the server name and the wizard, after I do that, finds all the databases on my server installation. Only when I hit OK from that point do I get the error. I appreciate the help, though.

    :)


  • Noldona

    HI,

    I've read in your past post that you are using Visual Studio 2003. I think its not possible to connect to an instance of SqlServer 2005 Express through VS2003 (since you cannot also use enterprise manager to do this). If you want to edit your database its better to use the Management tool specially for SQLExpress.

    You can download the MAnagement Studio for SqlExpress here:

    http://msdn.microsoft.com/vstudio/express/sql/

    cheers,

    Paul June A. Domag



  • Luke R

    I am having this same problem. I installed SQL Server 2005 Express Edition today and I have the .NET Framework 2.0. When I try to connect to my database using the VB.NET 2003 Server Explorer, I get a message that says:

    Error enumerating data servers. Enumerator reports 'Unspecified error'

    So, instead of choosing a database from the dropdown list, I type in the name of my server, choose my database, choose Windows NT Integrated Security, and test the connection. It says it works. Then, when I hit OK, I get a message that says:

    Unable to connect to the database. It is only possible to connect to SQL Server Desktop Engine databases and Microsoft Access databases with this version of Visual Studio

    Any ideas Am I still able to get the MSDE I tried to install VB.NET 2005 a few months back but it won't run under XP Home Edition.


  • hfrmobile

    You may be using Visual Studio Standard Edition. If this is the case I believe Visual Studio Standard Edition database tools will only work with Access and MSDE. If you try to connect Visual Studio Standard Edition Database tools to SQL 2005 or SQL 2005 Express edition it will display an error message stating that: It is only possible to connect to SQL Server Desktop Engine databases and Access databases with this version. You can still get around this by writing code, and not using the Visual Designers. (Might as well go code under linux). Code sample could be:

    Dim cnnConection As SqlConnection


    cnnConection =
    New SqlConnection

    Try


    cnnConection.ConnectionString = "packet size=4096;user id=sa;data source=samitha2k\BUSINESSAIM;persist security info=False;database=master"

    cnnConection.Open()

    Catch exception As Exception

    MessageBox.Show(exception .Message)

    End Try

    ' Thanks samitha

    However I think I prefer using the visual designer tools so what I'm going to attempt to do is create a an MDB link tables to SQL Server Express, then use the visual tools to connect to my Access DB. Later I will adjust the code to instead connect to SQL Server Express.

  • Worf

    ADO.net hasn't changed.

    How are you trying to connect

    Adamus



  • GaV56

    should be possible, what error messages are you getting Can you also post some code

  • Jim P.


    Assuming you've installed SQL Server Express 2005 on your development machine you probably want to specify (local) as the Data Source. You could also use <MACHINE_NAME>\SQLEXPRESS.

  • Visual Studio 2003.net Databases Connection not working