I need an advice...

F

Fabrizio Romano

Hello,

maybe I'm OT, but I don't know where else I can put this question.
Say you have to write a program for a very small company (5 pc). They just
need to store some data in a database which is on a server and they need to
access this database from some other computers, with client applications.
All these pc are connected in a lan.
What is the best approach I can follow to do this?
I thought about writing 2 applications: the first to be installed on the
server, will deal with the database, and the second, installed on the other
computers, deals with the first one.
In case this is the right way, what technology should I use? Remoting? Web
service? Windows service? Something else?
Or maybe just forget about the server application and connect to the
database directly through the lan network?
Or maybe nothing I just wrote...

Can anyone help me? I just need a guideline, in order to be able to approach
the problem knowing at least what I have to do.
How to do it will come later.

I program in C#2.0 with VS05 and SQLEXPRESS.

Thank you in advance and happy 2007!

Fabrizio
 
C

Cor Ligthert [MVP]

Or maybe just forget about the server application and connect to the
database directly through the lan network?
You are living in 2006 not in 1975

Cor
 
M

Miha Markic [MVP C#]

Hi Fabrizio,

Fabrizio Romano said:
Hello,

maybe I'm OT, but I don't know where else I can put this question.
Say you have to write a program for a very small company (5 pc). They just
need to store some data in a database which is on a server and they need
to access this database from some other computers, with client
applications. All these pc are connected in a lan.
What is the best approach I can follow to do this?

Depends on the requirements (security, scalability, etc.). Since there
aren't many users and, I presume application runs on intranet, I would go
with 2-tiers (fat client connects directly to the database) as it is easiest
to build.
I thought about writing 2 applications: the first to be installed on the
server, will deal with the database, and the second, installed on the
other computers, deals with the first one.

This is a better but more complicated/complex approach.
In case this is the right way, what technology should I use? Remoting? Web
service? Windows service? Something else?

If client is always a .net then you should definitely go with remoting. If
you don't know what the client is/would be then web services are way to go.
Or maybe just forget about the server application and connect to the
database directly through the lan network?

Yep, this is the easiest approach.
Or maybe nothing I just wrote...

Can anyone help me? I just need a guideline, in order to be able to
approach the problem knowing at least what I have to do.
How to do it will come later.

I program in C#2.0 with VS05 and SQLEXPRESS.

Thank you in advance and happy 2007!

:)
 
F

Fabrizio Romano

@Cor
If you think that being MVP means you can consider yourself to be better
than someone else who is trying to learn, I'm sorry for you pal, because
there is so much you still have to learn about life...
You've been a noob too, and probably luckyer than me when you got real
answers to your questions and not just some useless sarcasm.
But thank you anyway MASTER, because you've given me another opportunity to
train myself in patience.

@everyone else
Any serious suggestion out there please?

Regards
Fabrizio
 
F

Fabrizio Romano

Hi Miha,

yes, there are a few people working on it and it has to run in intranet.
I'm not worried about complexity, since I have already written db
applications and remoting applications too.
I was just asking because I have never combined the 2 things and wanted to
be sure about that being a good idea.
My dubts came out for concurrecy problems, which I think I could handle
better if I had some application running on the server.
And also, since the final price is always important expecially for small
companies I have to check if I can do it the easy way (fat client with
direct connection) with sqlexpress.

Thank you for your advices.

Best regards,
Fabrizio
 
M

Miha Markic [MVP C#]

Fabrizio Romano said:
Hi Miha,

yes, there are a few people working on it and it has to run in intranet.
I'm not worried about complexity, since I have already written db
applications and remoting applications too.
I was just asking because I have never combined the 2 things and wanted to
be sure about that being a good idea.

It is certainly better than doing direct database access. Yet, it is more
complex. Perhaps you might even consider using a ORM (LLBLGenPro
recommended).
My dubts came out for concurrecy problems, which I think I could handle
better if I had some application running on the server.

Define better :)
How do you handle concurrency? Simplest way would be to store modified data
in a transaction and if it fails, it fails. User should reload data and
modify it again. While it can be problematic (for user to modify data again)
it is quite doable since usually there aren't many concurrency clashes.
Again, it depends on application.
And also, since the final price is always important expecially for small
companies I have to check if I can do it the easy way (fat client with
direct connection) with sqlexpress.

Also consider using an ORM (see above). It will do much of the
database-related work for you.
Thank you for your advices.

You're welcome.
 
F

Fabrizio Romano

Well, to handle concurrency there are different ways.
I was thinking about storing in a table the timestamp of last read/write
access and when a user submits his modifications I'm going to ask for
confirmation in case someone has retrieved that data after him.
But this will depend on requirement I haven't been given yet.
I'll take a look at that ORM you suggest, honestly I don't know what it is.

Thanks again,
Fabrizio
 
W

William \(Bill\) Vaughn

Fabrizio,
Your requirements are the same as many, many others and can be solved
fairly simply and cheaply. Since you have so few users you can get away with
using SQL Server Express edition (the free version) on the server. You don't
need a server-side application (like a Web Service) or an ASP.NET approach.
Create a Windows Forms application to connect to the SQL Server (which must
be configured to work on the LAN (Intranet) as it's default configuration
makes it invisible to the LAN. My book should help quite a bit with this
approach as it discusses virtually every aspect of the system. Be sure to
buy Visual Studio Professional or better as the tools in the Express version
are really not sufficient to help. You'll also want to get the SQL Server
Management Studio Express toolkit (free) download. Good luck.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
W

William \(Bill\) Vaughn

Timestamp concurrency is easy and relatively foolproof. Now that the
CommandBuilder recognizes it, Visual Studio can help build the code as well.
I expect ORM is overkill for this project. Stick with simple approaches.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Fabrizio Romano said:
Well, to handle concurrency there are different ways.
I was thinking about storing in a table the timestamp of last read/write
access and when a user submits his modifications I'm going to ask for
confirmation in case someone has retrieved that data after him.
But this will depend on requirement I haven't been given yet.
I'll take a look at that ORM you suggest, honestly I don't know what it
is.

Thanks again,
Fabrizio
 
C

Cor Ligthert [MVP]

Can you explain why this answer, because for throwing mud you don't have the
need for much expirience in live as you show.

Everybody else has given you the same answer as me, I only have used less
words.

Cor
 
M

Miha Markic [MVP C#]

William (Bill) Vaughn said:
Timestamp concurrency is easy and relatively foolproof. Now that the
CommandBuilder recognizes it, Visual Studio can help build the code as
well. I expect ORM is overkill for this project. Stick with simple
approaches.

I would use ORM. It creates much of the required sql code for you + (big
plus) it behaves very well when database structure changes by strong typing.
For example, if you change a field name in a table (or whatever) you won't
notice (sql approach) until you run the application. And what's worse, you
would have to check all sql statements when this happen. And it will happen.
OTOH a good ORM would recreate all the code for you and yell error at
compile time.
Overkill? I don't think so. I guess we disagree :)
 
W

William \(Bill\) Vaughn

The Express edition only supports the "Database" explorer which does not
have the flexibility and features of the Server Explorer. When working with
detached databases as you propose, having the SE can help manage the remote
server, create schemas, SPs, tables etc on the remote server. The DE is
designed to (only) work with local databases like SQL Express in local
(non-shared) /project mode. I explain all of this and far more in my book.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
 
G

Guest

Bill,

Thanks for the info.

I've never been a big fan of Server Explorer. I prefer to use the VS IDE for
code development and the SQL Sever IDE (Management Studio, etc) for database
development.

So I think that for my purposes the Express edition of VB2005 would work fine.

By the way, I've been looking at your book on Safari Books Online and it is
definitely on my very short list of books to buy with by Christmas money.

Kerry Moorman
 
C

Cor Ligthert [MVP]

Kerry,

I had the same idea in past, however it is not right to compare the 2005 SQL
Server Management version with the older types, expecially the first ones
were giving more work than taking it away. The 2005 version works very
handy. Although it is still gives me the idea that I am working with a
Microsoft tool as you would think Microsoft tools works always forever.

Just my idea

Cor
 
C

Cor Ligthert [MVP]

Miha,

As last the OP wrote.

Or maybe just forget about the server application and connect to the
database directly through the lan network?

That was what he would do in my idea, all other scenario's are an overkill
for 5 pc's in a Lan.
In 1975 I would not have done that, because the database servers did me than
nog give the possibilities as now.

I had not the idea that Bill or you were advicing something else?

Cor


Miha Markic said:
He was asking which method is more suitable and I responded with pros and
cons of methods he mentioned. Bill was also helpfull.
But I really don't see how your answer fits in this scenario...

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


Cor Ligthert said:
Can you explain why this answer, because for throwing mud you don't have
the need for much expirience in live as you show.

Everybody else has given you the same answer as me, I only have used less
words.

Cor
 
C

Cor Ligthert [MVP]

Bill,

I have never had any problem to recognise concurrency errors using the
commandbuilder can you tell me what the problems are?

Cor

William (Bill) Vaughn said:
Timestamp concurrency is easy and relatively foolproof. Now that the
CommandBuilder recognizes it, Visual Studio can help build the code as
well. I expect ORM is overkill for this project. Stick with simple
approaches.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
C

Cor Ligthert [MVP]

Gives me not the idea.


Cor Ligthert said:
Kerry,

I had the same idea in past, however it is not right to compare the 2005
SQL Server Management version with the older types, expecially the first
ones were giving more work than taking it away. The 2005 version works
very handy. Although it is still gives me the idea that I am working with
a Microsoft tool as you would think Microsoft tools works always forever.

Just my idea

Cor
 
F

Fabrizio Romano

Thank you.
I'm not using the express version of VS, I have the professional version,
but I personally don't have a SQL2005 instance on my pc, since it costs a
lot and SQL express is quite enough for me.
I also have the SQL Management studio express on my pc.

I'll see what to do, now I have a clearer idea of what I need.

Regards,
sfabriz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top