I have a c# windows application (Ticketing System) and I connect to the database on server (Primary Server) by the network, also I have another server used as a replication server (Secondary Server), my question is How to make my application connect to the second server (Secondary) automatically if the first server not work or I can't connect to it.
I need my application to be online always with the database and it connect to the available server (try server # 1 if failed connect to server # 2).
Google for "SQL Server High Availability". This really has nothing to do with your application code. Your code shouldn't care at all about each individual SQL Server and how to connect to it. All it should know is how to connect to the "cluster".
Keep in the mind that this is expensive and there is no way to reduce any servers downtime to zero. If you implement your "poor mans" solution, remember, you get exactly what you pay for. You may get a cheaper solution the way you want to do it but you also give yourself an administrative nightmare. If the list of servers changes how are you going to tell the clients that and update them?
You have no control over the client hardware, such as network interface, the quality of the connection between the client and the servers, the router and switch hardware between the client and servers, the server hardware itself, ...
I am very much a newbie, and am trying to teach myself. I have been following through tutorials on CodeProject. Invariably, I come across a problem, which I can't solve, so I post a message. None of these questions get an answer, despite me giving all the details. The latest is
stebo0728, 2 Jun 2016 CPOL
4.75 (3 votes)
I posted the question: I get the error: An error occurred attempting to determine the process id of the DNX process hosting your application. I should hope I might some sort of reply, but I doubt it.
That question will be answered by the author of the article when he/she sees your message. Please learn to be patient, everyone here helps in their own time, many have full time jobs, and some even take time off at the weekend.
There are a couple of reasons: first off it's a weekend, so much of the western world is busy "getting a life" or in many cases "recovering from getting a life last night" and aren't at work. Since everybody answering questions is a "normal" member - just like you - many of them answer questions when at work, not when out enjoying the sunshine! Secondly, you are trying to talk to one specific person: the author of the article. We know he is still active, because the article was posted recently, but there is a good chance that he uses his work email to sign in (so he gets messages during the working day) and that he won't find out you want to talk to him until next time he's back in the office.
But...can I suggest that you are going about this totally the wrong way?
Member 11740855 wrote:
I am very much a newbie, and am trying to teach myself. I have been following through tutorials on CodeProject.
First off, most of the articles here aren't specifically tutorials: they are a solution to a problem rather than trying to teach you "how to do MVC" - and I would steer well clear of articles which do claim to teach you how to do it! Secondly, that's a bad approach. The trouble with trying to learn on your own but finding "tutorials" and reading them is that you don't know if there is something you have missed. If you follow a structured course, they explain and introduce all the important bits in a logical order so it's easy to follow and you know that they haven't just skipped the important bits. Go on a course (best), get a book (second best) and follow it through, do all the exercises. But finding tutorials online and hoping they cover the subject (or even are written by people who know what they are talking about and can actually teach)? Not a good method. It's like trying to learn to drive a car by starting on the motorway / interstate...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
Many members consider it rude to post a question like "I receive error X when running my application." without any information on what you're trying to achieve or what you did to lookup a solution yourself. (didn't see your post so I don't know if you did or didn't)
Thanks to all the people who've replied. First of all, the example I gave was the most recent, I have other examples going back weeks. I don't think I broke the rules about replying, I was not being critical, just trying to find out why I couldn't get something to work. Though I consider myself a newbie, I also have a long history of being a developer, and debugging. I can usually find out what is going wrong, and only post when I can't work it out myself. If the article writers would just put exactly what you need at the top of the article, that would help. Respect to you all, and the original writers.
But I am receiving an error, and I don't know how to fix it.
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Currency_convert.Form1.resources" was correctly embedded or linked into assembly "Currency_convert" at compile time, or that all the satellite assemblies required are loadable and fully signed.
If someone can please help me, I would really appreciate it.
It appears the author of this March 2007 article has not answered a question on the article since July 2007.
I was able to download the source code, open the project in VS 2013, and compile with .NET FrameWork 4.5. I removed the ASP.Net example from the project. I set the WinForms Demo as the startup project.
The author put this code up as a signed assembly. You need to open the Zayko.Finance.CurrencyConverter Properties in the Solution Explorer and uncheck the 'use signed Assembly' in the Signing tab.
The code is making web-requests to Yahoo's finance server, and I wouldn't be surprised if some of the currency codes may have changed.
But, I was able to run the project and see some apparently valid conversions.
I suggest you consider code like this ... from articles several years old, with no recent replies by the author to comments ... as code you can study and learn from, rather than code you can use as-is for any real-world application.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
I am using SQL 2005. I have one table has many records, I open a table from SQL Server 2005 does not see commodity code '005' but when I query commodity code '005' is seen. you know why ? you fix this ?