.NET Forum / .NET Framework / ADO.NET / December 2006
I need an advice...
|
|
Thread rating:  |
Fabrizio Romano - 28 Dec 2006 10:28 GMT 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
Cor Ligthert [MVP] - 28 Dec 2006 14:12 GMT > 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
Miha Markic [MVP C#] - 28 Dec 2006 14:30 GMT >> 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.
 Signature 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/
Fabrizio Romano - 28 Dec 2006 14:36 GMT @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
>> 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 Cor Ligthert [MVP] - 28 Dec 2006 21:33 GMT 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
> @Cor > If you think that being MVP means you can consider yourself to be better [quoted text clipped - 17 lines] >> >> Cor Miha Markic [MVP C#] - 28 Dec 2006 21:48 GMT 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...
 Signature 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/
> Can you explain why this answer, because for throwing mud you don't have > the need for much expirience in live as you show. [quoted text clipped - 25 lines] >>> >>> Cor Cor Ligthert [MVP] - 29 Dec 2006 09:19 GMT 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
> He was asking which method is more suitable and I responded with pros and > cons of methods he mentioned. Bill was also helpfull. [quoted text clipped - 29 lines] >>>> >>>> Cor Fabrizio Romano - 29 Dec 2006 16:07 GMT Yes I can explain. It's very hard to believe that yours is a serious answer. You claim you were serious and this is all a big misunderstanding... ok I want to believe that. Let me tell you a couple of things though. Given "You are living in 2006 not in 1975" you could understand either "we can do it now, since modern technology lets you do that" or "please be serious, that stuff is something we don't do since 1975", hence one thing and its opposite. To my remote-db-noob eyes that is something I don't understand, even if I wanted to see a good intention in your comment. The problem is that maybe you took for granted that I would have understood what you were saying, but unfortunately I didn't. And I think that there maybe be very few people who could.
Your answer made me feel very very small anyway and as the Dalai Lama says: "consider your enemy as a supreme MASTER, because he will give you the rare opportunity to train yourself in patience.". Hence I said thank you. Of course I was ironic writing Master to you, but I really really thougth you were just sarcastic with me with no reason.
Concluding, please don't be upset with me because it would be bad for you. I wish you to spend a wonderful new year's eve.
regards, fabrizio
> Can you explain why this answer, because for throwing mud you don't have > the need for much expirience in live as you show. [quoted text clipped - 25 lines] >>> >>> Cor Cor Ligthert [MVP] - 29 Dec 2006 16:30 GMT Fabrizio,
I understood after your first answer that it could be misunderstand. But why, that is not the way we threath each other in these Internatinal Net newsgroups, we try to help. It can be opposite but than at the end of a discussion.
This is what I did: you were asking
>>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. You had given your own correct answer and I copied that.
> Or maybe just forget about the server application and connect to the > database directly through the lan network? The word "just" in the sentence, made that I made my answer for the rest as it was. I could have written as well, take the most easiest method. They are all correct but I prefer the one I show now, the other ones have for me a smell to old not needed methods anymore.
Happy new year,
Were are you living in Italy?
Cor
> Yes I can explain. > It's very hard to believe that yours is a serious answer. [quoted text clipped - 52 lines] >>>> >>>> Cor Fabrizio Romano - 30 Dec 2006 23:59 GMT >"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote: >Were are you living in Italy? Answered via mail.
Cheers, Fabrizio
Miha Markic [MVP C#] - 28 Dec 2006 14:30 GMT Hi Fabrizio,
> Hello, > [quoted text clipped - 4 lines] > 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... > [quoted text clipped - 5 lines] > > Thank you in advance and happy 2007!
:-)  Signature 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/
Fabrizio Romano - 28 Dec 2006 14:49 GMT 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
> Hi Fabrizio, > [quoted text clipped - 41 lines] > > :-) Miha Markic [MVP C#] - 28 Dec 2006 15:15 GMT > Hi Miha, > [quoted text clipped - 3 lines] > 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.
 Signature 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/
Fabrizio Romano - 28 Dec 2006 15:52 GMT 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
>> Hi Miha, >> [quoted text clipped - 28 lines] > > You're welcome. William (Bill) Vaughn - 28 Dec 2006 18:53 GMT 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.
 Signature ____________________________________ 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) -----------------------------------------------------------------------------------------------------------------------
> Well, to handle concurrency there are different ways. > I was thinking about storing in a table the timestamp of last read/write [quoted text clipped - 39 lines] >> >> You're welcome. Miha Markic [MVP C#] - 28 Dec 2006 21:44 GMT > 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 :-)
 Signature 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 [MVP] - 29 Dec 2006 09:23 GMT Bill,
I have never had any problem to recognise concurrency errors using the commandbuilder can you tell me what the problems are?
Cor
> Timestamp concurrency is easy and relatively foolproof. Now that the > CommandBuilder recognizes it, Visual Studio can help build the code as [quoted text clipped - 45 lines] >>> >>> You're welcome. William (Bill) Vaughn - 28 Dec 2006 18:51 GMT 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
 Signature ____________________________________ 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) -----------------------------------------------------------------------------------------------------------------------
> Hello, > [quoted text clipped - 22 lines] > > Fabrizio Fabrizio Romano - 29 Dec 2006 11:37 GMT 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
> Fabrizio, > Your requirements are the same as many, many others and can be solved [quoted text clipped - 38 lines] >> >> Fabrizio William (Bill) Vaughn - 29 Dec 2006 20:15 GMT SQL Server Express is a SQL Server instance... ;)
 Signature ____________________________________ 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) -----------------------------------------------------------------------------------------------------------------------
> Thank you. > I'm not using the express version of VS, I have the professional version, [quoted text clipped - 49 lines] >>> >>> Fabrizio msgroup - 31 Dec 2006 01:22 GMT Hi, Fabrizio:
You may use our SocketPro at www.udaparts.com. Inside the package, there are many database samples and tutorials to show you how to securely access ANY remote database ANYWHERE with ANY types of networks (LAN, Wireless, Modems, Dialup).
See the article at http://www.udaparts.com/document/articles/dialupdb.htm
With help of SocketPro, you can write a professional application in a few days with decent performance for all of types of networks.
Regards,
> Hello, > [quoted text clipped - 22 lines] > > Fabrizio Fabrizio Romano - 31 Dec 2006 10:13 GMT Thank you, I'll have a look at it.
Regards, Fabrizio
> Hi, Fabrizio: > [quoted text clipped - 37 lines] >> >> Fabrizio
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|