Why this limitation in C#express

Here is a problem with my C# express installation.(RTM). With the
previous version it was possible to connect to the SQL Server Express specifing a server and a database(add connection).
Now it is only possible through "AttachDBFileName". So I cannot connect to
the SQLEXPRESS if I don't specify "Database file name(.mdf file)". Is that correct
In the VWD it is possible Why this limitation in C#express

In the "Change Data Source" dialog, there are only two Data sources: "Microsoft Access Database file" and "Microsoft SQL Server Database file", NOT "Microsoft SQL Server".

Thanks.


Answer this question

Why this limitation in C#express

  • Lorenzo77

    Ouch, that sucks.

    I've been pulling my hair out trying to connect to a SQL 2000 Server Personal Edition database running on the local machine, guess I now know why.

    Is this the same also for Visual C++ and VB (express)

  • gearcam

    Hi,

    I guess these feature was stripped to prevent the user from connecting to a remote sql-server (which is also a limitation of express). The VWD wasn't included in the limitation of remote access, that's why it wasn't stripped of that feature..




    cheers,

    Paul June A. Domag


  • Dragonfire427

     Paul Domag wrote:
    Hi,

    Yup. Except for VWD (Visual Web Designer).





    cheers,

    Paul June A. Domag


    Damn, you're right.. just tried connecting to a SQL 2000 Server now using OLE under Visual Web Developer, works fine.

    This makes no sense though, why limit it under all but one express version

    Microsoft Can we please have some comment as to why we can connect via OLE etc under Visual Web Developer but not under C++, VB and C# !

  • mrg209

    For a newbie, does there exist a code snippet that can be used to connect a C# express application to a database (rather than an attached file)

    An example would be most helpful.

  • TSCR

    Wait, what I can connect to a remote MySQL server just fine. Are you saying I can't install SQL Server Express on one machine on my network and access it from other machines in VC# Express I hope this is not the case because I need to prototype and test an old Delphi app I am porting to C# a bit before we spend money for the full SQL Server and V. Studio Pro.

  • Lazy-J

    I was considering purchasing a copy of VS2005, and I see that the Standard edition doen't appear to come with a database.  Is that correct, and will it have the same restrictions as C# Express   I want to be able to connect to SQL Express locally, and  Oracle 10g and MySQL remotely.



  • TenTwenty

    SadNot much help there.  We keep coming back to the wizard, as in
    "

    To create the data connection and data adapter

    1. From the Data tab of the Toolbox, drag an OleDbDataAdapter object onto the form.
      Note   You could also use the SqlDataAdapter, which is optimized for working with SQL Server 7.0 or later. In this walkthrough, you use the OleDbDataAdapter because it is more generic, providing ADO.NET access to any OLE DB-compatible data source.

      The Data Adapter Configuration Wizard starts, which will help you create both the connection and the adapter.

    2. In the wizard, do the following:
      1. In the second pane, create or choose a connection pointing to the SQL Server Pubs database.
      2. In the third pane, specify that you want to use an SQL statement to access the database.
      3. In the fourth pane, create the following SQL statement:
        SELECT au_id, au_lname, au_fname, city, state, phone, contract FROM authors"

    Since the Wizard has a very limited set of connection types (which is the problem here) going to the wizard to make a connection 0other than what the wizard allows is futile.



  • Robert Warnestam

    Hi,

    You can definitely connect through code. But you cannot connect using the Express environment (Data Sources).



    cheers,

    Paul June A. Domag


  • dreamworks

    Paul is correct in his reply above about why we decided to allow remote database access in Visual Web Developer Express.  The typical situation for Visual Web Developer is to build a web site which will be hosted by some hoster on the web.  Since many of these hosters require data to be stored on a seperate machine, it is critical to allow VWD applications to access remote databases.  The same is not true for client (Windows) applications.  For most simple client applications, the database is used to store data locally. 

    Thanks,
    Luke Hoban
    Visual C# IDE Program Manager


  • AmyPaapu

    Hi,

    Here's a ADO.Net walkthrough that you might find useful. Using these codes, you can acess a remote sqlserver instance.




    cheers,

    Paul June A. Domag


  • Ed Allan

    Hi,

    Yup. Except for VWD (Visual Web Designer).





    cheers,

    Paul June A. Domag


  • ErsinINAN

     pkw wrote:
    I was considering purchasing a copy of VS2005, and I see that the Standard edition doen't appear to come with a database.  Is that correct, and will it have the same restrictions as C# Express   I want to be able to connect to SQL Express locally, and  Oracle 10g and MySQL remotely.



    Hi,

    Here's a product comparison of VS2005 product line.



    cheers,

    Paul June A. Domag


  • Kalle Hiitola

    Hi,

    IMHO, microsoft enabled it in VWD because it would be pretty much useless if you can't connect to an online or external database. Web applications usually are developed with remote database servers, while windows forms application could live with a local database. A reminder, Visual Studio Express are Free and are designed to be used by Hobbyists and students. If you want a more programmer-intended software, then I would suggest using VS2005 professional...





    cheers,

    Paul June A. Domag


  • byteknight

    Do a search in the MSDN library (http://www.msdn.com) for SqlConnection, SqlDataAdapter, SqlCommand, and their related classes.  I think that should give you what you want.

  • Why this limitation in C#express