views:

137

answers:

5

Hi!

I want to install a desktop application (on many stations - about 10-20) should access the SQL Server directly, no Services, and no server-DALs.

The application will be installed on a local network on about 10 machines, while one of them is a server. When I will install the program I will set the connection string, and the applications will talk directly to the SQL server.

Is this a bad idea?

If yes, then how bad?

+4  A: 

It is not necessarily a bad idea. If you won't need to scale then it's a valid approach.

What you are describing is often called a 2-tier client-server architecture.

You should probably encrypt the connection string in the config file (but this will only stop prying eyes, not someone intent on recovering your password). The other option is to use Windows authentication via a trusted connection, but you do lose the ability to connection pool, but that should not be an issue with 10 - 50 clients (ballpark).

Mitch Wheat
I don't care the conn string to be public, it's a program that doesn't hide any data.Your info was very important.Thanks a lot!
Shimmy
+2  A: 

I have built plenty apps like that. I would suggest you build a DAL that is in the app itself so that if you ever need to separate data access and presentation layers, you can do so easily (plus there are other benefits like standardization of code, single place to change things, etc).

I don't see an issue with it as long as you are consistent and follow best practices.

Raj More
That's what I did, I built the DAL inside the app, the DAL is even asynchronous!
Shimmy
+4  A: 

Of course not.

What your describing is classic Client Server architecture, and around 50% of apps are still built this way, according to a survey I saw recently.

Bob.

scope_creep
Thank you very much!
Shimmy
+1  A: 

If it's on your local network, go for it. If it's over the internet, I'd create a web service.

CitizenBane
A: 

Also note that there are plenty of off-the-shelf DALs (NHibernate, Entity Framework) so you don't need to roll your own, and the work just as well in client server architectures.

ShellShock
I AM using EF, I just didn't know if it's good to have it in the same assembly, I thought it must go thru a DAL server-service.
Shimmy