Database Connection in CodeBehind???

  • Thread starter Thread starter Kris Rockwell
  • Start date Start date
K

Kris Rockwell

Hello,

Is it possible to hide the database connection information using the
CodeBehind capabilities of ASPX? If not, what would be considered the best
practice to do so (i.e., would creating a .NET class or module and
referencing it in the code work? If so, what is the proper way to do this?)?

I am trying to develop an ASPX application that will run on the client side
rather than as a server application. As such, I don't want there to be any
way for the users to view the code (or at least minimize the code exposure).

Thanks in advance,
Kris
 
Compile the .aspx into a dll a deploy THAT rather than deploy .aspx files that are built "on the fly

Not sure I see the benefit of deploying an ASP application to users though: why not just write a Windows Forms application

(e-mail address removed)
 
Well, the benefit is that I can use the application on in both a web
environment and as a client/server application if needed. This also provides
a good bit of flexibility when it comes to using the application in a
disconncted state.

How might I go about compiling the ASPX as a DLL?

I used to be really familiar with all of this when it was simply asp. Then I
became a manager. Now I am simply lost. I know there is some form of morale
to this story...

Regards,
Kris


alaspin said:
Compile the .aspx into a dll a deploy THAT rather than deploy .aspx files that are built "on the fly"

Not sure I see the benefit of deploying an ASP application to users
though: why not just write a Windows Forms application?
 
Well, I'm new to this too but I believe you can

1. just deploy the HTML/.aspx (NOT the code-behind source)
2. deploy the .dll you find in the "bin" folder of your application (unsure if you need to regsvr it or if it will be picked up "on the fly" so long as it is still in "bin")

That way you're precious database connection string is shielded inside the dll and nobody gets the .vb/.cs source code

Still working my way through Mr Balena's book - what a guy

(e-mail address removed)
 
Correct.
Just copy the .aspx pages (and web.config) and folders to the new machine.
The /bin folder will have your compiled code as a .dll with your app name.

De-compiling a .dll file is very simple though so your source is not
protected against someone who really wants to see it. Obfuscation will help
if you can run it. There is a free (limited) obfuscator built-in to VS.Net.
--
Joe Fallon




alaspin said:
Well, I'm new to this too but I believe you can:

1. just deploy the HTML/.aspx (NOT the code-behind source).
2. deploy the .dll you find in the "bin" folder of your application
(unsure if you need to regsvr it or if it will be picked up "on the fly" so
long as it is still in "bin").
That way you're precious database connection string is shielded inside the
dll and nobody gets the .vb/.cs source code.
 
Back
Top