-1

I had a software that was written on VB .Net and used Crystal Report to print out reports. It was a pain to maintain in my case, so I want to move the report to webpage version.

I did some researches and found out that it was more safe to connect database from server side on webpage. However, I want to know if there is any way to connect database from client side and it hides the connection string. Any mix way is fine. (I tried using java applet to connect database, but it didn't allow me to run from local file on webpage).

Is there any way I can connect to database from client side and hide the connection string?

Thanks

P.s. I use Firefox as a main browser.

closed as unclear what you're asking by gnat, Tulains Córdova, gbjbaanb, user40980, durron597 Jul 10 '15 at 0:45

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Which database? – RemcoGerlich Jul 9 '15 at 14:28
  • 1
    Unclear what help you need. Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it’s hard to tell what problem you are trying to solve or what aspect of your approach needs to be corrected or explained. See the How to Ask page for help clarifying this question. – gnat Jul 9 '15 at 14:30
  • 1
    Why do you need the connection to be done from the browser instead of from the web server? – Tulains Córdova Jul 9 '15 at 14:41
  • If I do any connection from server side, my application needs to run on a server which they don't give me one. I'm not allowed to put it on the database server either because of its ugly policy. I can't rent my own because the application is used several times in a year (not worth for develop and testing). – momon Jul 9 '15 at 14:49
3

No

Technically, it looks like there are some ways to connect directly to your database via HTTP (google "sql server http endpoint deprecated" and "ado.net data services") but you cannot hide the connection information if it is on the client.

This is a crazy bad idea -- don't do it.

One of the first rules of web app programming is that the client cannot be trusted - all client code can be (fairly easily) hacked. Put the important bits (like connection strings) on the server where the bad guys have to at least work a little harder to get to them.

Your best approach would be to do what just about everyone else does - write a server based web app that connects to the database and delivers just the data to the client.

On a side note, within reason, which browser you're using shouldn't matter.

Not the answer you're looking for? Browse other questions tagged or ask your own question.