Click here to Skip to main content
15,887,746 members
Home / Discussions / Database
   

Database

 
AnswerRe: problems in setting up transactional replication in SQL Server 2000 Pin
alexrad10-Mar-07 22:47
alexrad10-Mar-07 22:47 
GeneralRe: problems in setting up transactional replication in SQL Server 2000 Pin
Rocky#11-Mar-07 23:18
Rocky#11-Mar-07 23:18 
Questioncleako freak , its too bad to ask help from one like u Pin
Mr.Kode9-Mar-07 13:53
Mr.Kode9-Mar-07 13:53 
QuestionRemote queries Pin
alexrad9-Mar-07 13:30
alexrad9-Mar-07 13:30 
AnswerRe: Remote queries Pin
Colin Angus Mackay10-Mar-07 0:23
Colin Angus Mackay10-Mar-07 0:23 
Questioncheck if row number is odd or even Pin
kani989-Mar-07 12:05
kani989-Mar-07 12:05 
AnswerRe: check if row number is odd or even Pin
Hesham Amin9-Mar-07 22:25
Hesham Amin9-Mar-07 22:25 
QuestionDesign question [modified] Pin
gumi_r@msn.com9-Mar-07 6:56
gumi_r@msn.com9-Mar-07 6:56 
Hi all,

I'm very new to designing and working with DB based apps so please forgive me if I write down things that can make seasoned developer's cry in aguish.

We are right now developping a Remote application scenario with a client app and a server app. The server app will be connected to a DB, SQL Server for more info, which is not, theoretically, reachable from any other machine in the intranet or internet. Only access is through the server app.

Ok the thing is we want the developers of our client app and the client app itself,which is basically 99% of the project workload, to "know as little as possible" of the DB behind the whole project and make all query and update to the DB as simple as possible (through the server app of course).

The design we (I) came up with is the following: (Shuts his eyes and prays he hasnt blown all major rules of designing applications and if so please forgive me)

The server app will have a main worker class named DbEngine which basically does all the work with a few helper classes. The method used to execute selection queries and bring back info to the client app would be the following:

byte[] ExecuteCommand(string commandName, Dictionary<string,object> parameters).

byte[] is a serialized datatable, compressed and most likely, allthough not yet encrypted.

The only thing the client application needs to know is what commandname to call and what parameterName and value to send if any. Please not that the parameters Dictionary does not store any Parameter class, its simply a string key with the parameter name (@columnname) and its value. Its pretty lightweight and easy to code.

The whole work is done in the server side. The thing is, we are storing a table in the SQL Server Database, which we would call TBL_SYS_COMMANDS with all the SQL/Stored Procedure commands our app is going to use. The info stored in this table would be:

[CommmandName] (Primary Unique Key)
[CommandText] (this would be a stored procedure name or a SQL command)
[CommmandType] (Text, StoredProcedure, etc. Server app would parse the string into the corresponding .NET enum)
[Parameters] (would contain custom serialization of parameter(s) info, except Value of course).

The server app would recieve the ExecuteCommand, look up the commandname in the cached TBL_SYS_COMMANDS datatable and if found, build up command and the parameters through reflection, assign their values, execute the command and send back info compressed in a byte array.

Security measures taken: The DbEngine class in the server side which takes care of executing the ExecuteCommand has a custom attribute with a list of allowed commandNames. If somebody somehow injected a harmfull command in TBL_SYS_COMMANDS it would not be executed because its not included in the custom attribute's allowed command list and the DBEngine class would throw a SecurityException...any new command needs the server code recompiled once the new command has been added to the allowed commands list in the DbEngine's custom attribute.

Thats basically it. Am I forgetting some great security hole somewhere storing my SQL commands in a database table? Is this design way to complicated? Basically we want to minimise coding and specially recoding if we make changes and fine tune the database, queries, stored procedures etc, and this system basically allows you to change all this without having to dig into almost any code at all...only update the allowed commands attribute.

Please recommend other approaches etc.

Thanks in advance, and sorry for the long post.













-- modified at 13:16 Friday 9th March, 2007
QuestionINNER and OUTER key words: What's the point? Pin
ToddHileHoffer9-Mar-07 2:35
ToddHileHoffer9-Mar-07 2:35 
AnswerRe: INNER and OUTER key words: What's the point? Pin
Colin Angus Mackay9-Mar-07 2:53
Colin Angus Mackay9-Mar-07 2:53 
QuestionLAN Application Pin
Mr.Kode9-Mar-07 2:14
Mr.Kode9-Mar-07 2:14 
QuestionLAN Application Pin
Mr.Kode9-Mar-07 0:52
Mr.Kode9-Mar-07 0:52 
QuestionRe: LAN Application Pin
N a v a n e e t h9-Mar-07 1:30
N a v a n e e t h9-Mar-07 1:30 
QuestionCreating Search Index Pin
N a v a n e e t h9-Mar-07 0:46
N a v a n e e t h9-Mar-07 0:46 
QuestionMirroring DB Pin
Tech_spidy8-Mar-07 22:07
Tech_spidy8-Mar-07 22:07 
AnswerRe: Mirroring DB Pin
N a v a n e e t h9-Mar-07 0:47
N a v a n e e t h9-Mar-07 0:47 
Questionbacking up the database without the actual data Pin
Rocky#8-Mar-07 20:52
Rocky#8-Mar-07 20:52 
AnswerRe: backing up the database without the actual data Pin
Hayder Marzouk8-Mar-07 21:33
Hayder Marzouk8-Mar-07 21:33 
GeneralRe: backing up the database without the actual data Pin
Rocky#9-Mar-07 20:45
Rocky#9-Mar-07 20:45 
Questionurgent on SQL Query Pin
Priya_20078-Mar-07 20:43
Priya_20078-Mar-07 20:43 
AnswerRe: urgent on SQL Query Pin
Harini N K8-Mar-07 20:55
Harini N K8-Mar-07 20:55 
GeneralRe: urgent on SQL Query Pin
Priya_20079-Mar-07 1:00
Priya_20079-Mar-07 1:00 
GeneralRe: urgent on SQL Query Pin
Marcus J. Smith9-Mar-07 3:57
professionalMarcus J. Smith9-Mar-07 3:57 
QuestionSQL SP [modified] Pin
daku18-Mar-07 17:04
daku18-Mar-07 17:04 
AnswerRe: SQL SP Pin
N a v a n e e t h8-Mar-07 20:15
N a v a n e e t h8-Mar-07 20:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.