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.
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
Re: Add New Data Source in Windows Application using C#
Thanks very much! I am using Express edition. I will try it through codes.
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.