Results 1 to 4 of 4

Thread: Add New Data Source in Windows Application using C#

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    240

    Add New Data Source in Windows Application using C#

    Hi Guys,

    I am trying to create a windows application using c# connected to a remote sql server database. Unfortunately, everytime I am trying to Add a New Data Source only two options I can choose under Data Source:

    Microsoft Access Database File
    Microsoft SQL Server Database File

    I think Microsoft SQL Server is missing from the list.

    If I am going to select Microsoft SQL Server Database File it will only prompt me to open a database file (*.mdf) which is not what I want. I want to connect to an SQL Database from remote server.


    Thanks in advance.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Add New Data Source in Windows Application using C#

    Are you using and Express edition by any chance? If so, that's the reason... Express editions will only allow you to connect to local database files using the wizard. It's still possible to connect to remote databases, but you have to do it all form code, losing the ability to manage the connection/database from the IDE.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    240

    Re: Add New Data Source in Windows Application using C#

    Thanks very much! I am using Express edition. I will try it through codes.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Add New Data Source in Windows Application using C#

    One thing you should be able to do is use a local database file to generate your Data Source and then edit the connection string in the config file so that, at run time, a server database is used.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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