473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Database Connection in CodeBehind???

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
Nov 18 '05 #1
5 2017
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

al*****@yahoo.com
Nov 18 '05 #2
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" <an*******@discussions.microsoft.com> wrote in message
news:44**********************************@microsof t.com...
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?
al*****@yahoo.com

Nov 18 '05 #3
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

al*****@yahoo.com
Nov 18 '05 #4
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" <an*******@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
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!

al*****@yahoo.com

Nov 18 '05 #5
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" <an*******@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
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!

al*****@yahoo.com

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50...
4
by: Kris Rockwell | last post by:
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...
2
by: Jeff | last post by:
Hi - I have an ASP.NET web page accessing a SQL database. It works fine on the web, and I'm trying to get it to also work in debug mode in the IDE. The "on the web" page and my SQL database...
14
by: Nick Gilbert | last post by:
Hi, I have an asp.net application which runs from a CD-ROM using Cassini. As such, it is single user only. The application connects to an Access database when it is loaded, and keeps the same...
13
by: Daniel Walzenbach | last post by:
Hi, Imagine the following situation: I have an asp.net application which allows uploading files to a SQL Server 2000 database (Files are stored as type "images"). As a next step I would like to...
1
by: bennett | last post by:
I'm trying to write an ASPX page that uses an OleDbDataAdapter to get data from a SQL Server database. When I test the connection, it returns success, and when I preview the data using the...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
35
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection...
3
by: daz_oldham | last post by:
Hi Everyone I'm going through the process of publishing my application to a testing server and I have been hit by a bit of a problem. Any pages where I am calling stored procs in my database...
1
Curtis Rutland
by: Curtis Rutland | last post by:
How To Use A Database In Your Program Part II This article is intended to extend Frinny’s excellent article: How to Use a Database in Your Program. Frinny’s article defines the basic concepts...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.