473,909 Members | 6,009 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 1017
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
5329
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
3874
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
2441
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
3121
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
5999
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 than a master of the art. I did not find an FAQ that answered it, but I think the FAQ
5
4080
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 now if two people have the same avg time one will be ranked 3rd and the other ranked 4th. I would...
0
2104
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 or it attempts to perform an action which doe not have the required permissions then its execution...
18
3167
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 ASP.Net process is recycled? This code executes pretty frequently (maybe 4 times per transaction) and...
37
6009
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 to code behind? Most of the stuff I've seen so far uses code inside, but that's probably
171
7866
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 overkill. I use Dreamweaver to do my design and find it a bit of a hassle to have multiple files open...
0
10035
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9877
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10919
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7248
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5938
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4774
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
3
3357
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.