473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# code in DB?

Hi all

Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)

Thanks for your replies!
Peter
Jun 27 '08 #1
8 1009
digory wrote:
Hi all

Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)

Thanks for your replies!
Peter
Since you can load assemblies from a byte array in memory or memory
stream, it's of course possible to do these things, provided you do them
right.

For instance, you might need to hook into the resolution mechanism of
the app domain to handle referenced assemblies, ie. you load assembly A
and ask for an object from it, which needs assembly B, that also needs
to be loaded from the database.

So yes, it's doable.

--
Lasse Vågsæther Karlsen
mailto:la***@vk arlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jun 27 '08 #2
digory <di****@gmx.net wrote:
Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)
You can certainly put assemblies into databases, just as byte arrays
(just like you'd put pictures in, basically). You might need to think
carefully about the security involved, however - executing arbitrary
code is somewhat dangerous. You might want to use something like
public/private key signatures to make sure that the code you're going
to execute really is trustworthy.

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #3
digory wrote:
Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)
It is possible.

But I do not like the approach.

The client app would be talking directly to the database
server. Database servers are usually less hardened than
web/app servers.

I do not see any benefits of having the code in the database.

It will require a lot of plumbing to get it working.

Arne
Jun 27 '08 #4
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
Jun 27 '08 #5
digory wrote:
Hi all

Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)

Thanks for your replies!
Peter
Hi there, you could place your assemblies (dlls) on a server and load
them dynamically from your thin client - I use this method in several of
my apps
Jun 27 '08 #6
If you're worried about the deployment process just write a web application
instead of a client app. I would avoid doing what you're doing at all costs,
even if it means more development time.

"digory" <di****@gmx.net wrote in message
news:07******** *************** ***********@d77 g2000hsb.google groups.com...
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
Jun 27 '08 #7
digory wrote:
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
You might want to reconsider frequent updates in a hospital or any other
healthcare environment. The cost of actually installing the software, even
if it has to be done by hand, would be miniscule compared to the
verfication/validation testing for safety, efficacy, and reliability.

Also, you could look at various deployment options which cache the code
locally, so losing a connection to the update server doesn't become a
catastrophe.
Jun 27 '08 #8
digory wrote:
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
I can still not see any reason to have in the database compared
to in the file system.

Have you evaluated click once as a possibility ?

Furthermore .NET is by default XCOPY deployable, so
they can very easily be upgraded.

Arne

Jun 27 '08 #9

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

Similar topics

51
5211
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
3848
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing users, and listing assignments use similar type commands. Is there a "better" way I can organize my code?
4
2419
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
3088
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
5751
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any question that identifies the warning signs to look out for, the things that most easily and clearly identify the author of code as something less...
5
4038
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each employee based on their region, zone, job code and avg job time. (See code below). My problem is that I do not know how to rank the ties. Right...
0
2079
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to allow it ro run then it will execute, the code execution depends on the permission provided to the assembly. If the code is not trusted wnough to run...
18
3142
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My question is what happens to the dynamically created assembly when the method is done running? Does GC take care of it? Or is it stuck in RAM until the...
37
5921
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes in a separate file from the HTML. Apart from the obvious advantage if you have a separate designer and programmer, are there any other advantages...
171
7601
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles) like it because you can split the code from the design. That is logical. But if you are the only one working on the code, it seem a little...
0
7468
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7808
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.