SQL Server and WCF Database File

I have a WCF service that provides a GetCustomers () method. Internal methods use the data layer along with the business layer to return a list of customers. I am currently using a SQL Server database file saved on the server. Everything works fine on my local network, but I want to move this to the internet.

I thought the best way would be to create a WCF IIS service that makes calls to the current WCF service GetCustomers (). I didn't have much experience with SQL Server database files, but I figured I would need to move the .mdf file to the IIS WCF Service App_Data folder, but I'm not sure how to change the database connection string and make it all work properly. The only thing I can figure out is that I will have to reimplement the GetCustomers () method in the WCF IIS service and point it to the correct database. It looks like I didn't need to do this.

I know that if I host the DB in a full SQL Server implementation, this won't be a problem because the connection string won't change. This is not an option at the moment.

I think I'm making it harder than it should be.

+1


source to share


1 answer


I have bad news - you cannot access SQL Server data files directly. You must be running SQL Server.

You are using the Access approach that works without any access server - you just specify your data source in a file and you're done. SQL Server files don't work this way.



If your database is small, consider Microsoft SQL Server Express , which has most of the capabilities of SQL Server without expensive licensing.

+1


source







All Articles