PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET I need an advice...

Reply

I need an advice...

 
Thread Tools Rate Thread
Old 28-12-2006, 10:28 AM   #1
Fabrizio Romano
Guest
 
Posts: n/a
Default I need an advice...


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


  Reply With Quote
Old 28-12-2006, 02:12 PM   #2
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: I need an advice...

> 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


  Reply With Quote
Old 28-12-2006, 02:30 PM   #3
Miha Markic [MVP C#]
Guest
 
Posts: n/a
Default Re: I need an advice...

Hi Fabrizio,

"Fabrizio Romano" <fabriz75@tin.it> wrote in message
news:45939c3a$0$4259$4fafbaef@reader1.news.tin.it...
> 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!


:-)
--
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/

  Reply With Quote
Old 28-12-2006, 02:30 PM   #4
Miha Markic [MVP C#]
Guest
 
Posts: n/a
Default Re: I need an advice...


"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:uJGQanoKHHA.1248@TK2MSFTNGP02.phx.gbl...
>> 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


Almost 2007, Cor.

--
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/

  Reply With Quote
Old 28-12-2006, 02:36 PM   #5
Fabrizio Romano
Guest
 
Posts: n/a
Default Re: I need an advice...

@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


"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:uJGQanoKHHA.1248@TK2MSFTNGP02.phx.gbl...
>> 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
>



  Reply With Quote
Old 28-12-2006, 02:49 PM   #6
Fabrizio Romano
Guest
 
Posts: n/a
Default Re: I need an advice...

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


"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:3E8ECAD8-7801-4B4A-A078-CBB15D79D1E5@microsoft.com...
> Hi Fabrizio,
>
> "Fabrizio Romano" <fabriz75@tin.it> wrote in message
> news:45939c3a$0$4259$4fafbaef@reader1.news.tin.it...
>> 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!

>
> :-)
> --
> 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/



  Reply With Quote
Old 28-12-2006, 03:15 PM   #7
Miha Markic [MVP C#]
Guest
 
Posts: n/a
Default Re: I need an advice...


"Fabrizio Romano" <fabriz75@tin.it> wrote in message
news:4593d97d$0$19106$4fafbaef@reader4.news.tin.it...
> 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.
--
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/

  Reply With Quote
Old 28-12-2006, 03:52 PM   #8
Fabrizio Romano
Guest
 
Posts: n/a
Default Re: I need an advice...

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

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%23I78WMpKHHA.4384@TK2MSFTNGP03.phx.gbl...
>
> "Fabrizio Romano" <fabriz75@tin.it> wrote in message
> news:4593d97d$0$19106$4fafbaef@reader4.news.tin.it...
>> 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.
> --
> 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/



  Reply With Quote
Old 28-12-2006, 06:51 PM   #9
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: I need an advice...

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)
-----------------------------------------------------------------------------------------------------------------------

"Fabrizio Romano" <fabriz75@tin.it> wrote in message
news:45939c3a$0$4259$4fafbaef@reader1.news.tin.it...
> 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
>



  Reply With Quote
Old 28-12-2006, 06:53 PM   #10
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: I need an advice...

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" <fabriz75@tin.it> wrote in message
news:4593e857$0$4247$4fafbaef@reader1.news.tin.it...
> 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
>
> "Miha Markic [MVP C#]" <miha at rthand com> wrote in message
> news:%23I78WMpKHHA.4384@TK2MSFTNGP03.phx.gbl...
>>
>> "Fabrizio Romano" <fabriz75@tin.it> wrote in message
>> news:4593d97d$0$19106$4fafbaef@reader4.news.tin.it...
>>> 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.
>> --
>> 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/

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off