|
One reason not to use a proxy server is that the browser must be configured to work with it, and that's a hassle for the user.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Compared to the hassle of individually supporting many browsers, it's a very small one.
We also don't know anything of the environment to which this app is being targeted.
|
|
|
|
|
I am a beginner to C# while reading i came a cross Cesign Patterns So Can anyone please tell what is this Design Pattern ?
- factory
- Singleton
- Chain of Responsibility
How they help in development of Applications ?
|
|
|
|
|
It's impossible to provide sufficient detail to your question in a forum like this. There are plenty of references on the internet that will explain, the purpose of design patterns, and the different types that may be used. There are also books that cover the subject in full detail.
Veni, vidi, abiit domum
|
|
|
|
|
|
You can buy a book on design patterns and go through them.
|
|
|
|
|
Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a catalog of simple and succinct solutions to commonly occurring design problems. dofactoy[^] shows C# and VB.NET sample code of any GoF (Gang of Four: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides) pattern.
Cheers,
Jani Giannoudis
Meerazo.com - Resource Sharing Made Easy | Co-founder
|
|
|
|
|
Design patterns are a dime a dozen. Since you are a "beginner", then I would focus on the fundamentals first, and worry about patterns later.
Good luck.
|
|
|
|
|
|
The code for that sample is available. Why not just look there?
|
|
|
|
|
Hi
Thanks. I am not experinced in programming, was just told that it was a silverlight code that was hard to reuse as an ordinary VS code. But when looking into the details you are right.
Kind regards
Espen
|
|
|
|
|
Excellent. I'm glad that has got you started.
|
|
|
|
|
I am developing a web application using asp .net 2010 where I need to generate barcodes plus qrcodes dynamically and need to print it on different platform with different sizes.
How to achieve it? Which dll is useful for this? Whether microsoft have in build functionality for this or not? If yes then which DLL?
Winners don't do different thing they do things differently.
|
|
|
|
|
|
There is no built in DLL in Windows or .Net - but there are several api's that can be downloaded (both free and paid) that will do this to varying levels and for various bar code types.
|
|
|
|
|
Hi,
I have date data supplied as a string in the following format...
"Mon Sep 9 00:00:00 UTC 0100 2013".
Firstly, what is this format?
Secondly, how can I use C# to convert it and stire it in a DateTime variable?
I've tried...
DateTime dt = Convert.ToDateTime("Mon Sep 9 00:00:00 UTC 0100 2013"); but this blows up
Many Thanks.
|
|
|
|
|
Also tried...
DateTime dt = DateTime.ParseExact("Mon Sep 9 00:00:00 UTC 0100 2013", "ddd MMM dd HH:mm:ss K yyyy", CultureInfo.InvariantCulture);
Doesn't work either...
|
|
|
|
|
See here[^]
it lists, d, D, f, F, g, G, M, m, O, o, R, r, S, t, T, u, U, y, Y as valid format strings, and below the table it says : Any other single character unknown specifier. Throws a run-time FormatException.
In my case it says: String was not recognized as a valid DateTime.
try to remove the K specification along with the 0100...
|
|
|
|
|
Thanks for the reply.
I can't get it to work as a UTC. If I change it to UTC+ by adding the plus sign in to replace the space directly after the UTC on the fly then parse I can get it to work...
string strStart = "Mon Sep 9 00:00:00 UTC 0100 2013";
strStart = strStart.Replace("UTC ", "UTC+");
DateTime dtStart = DateTime.ParseExact(strStart, "ddd MMM d HH:mm:ss UTCzzzz yyyy", CultureInfo.InvariantCulture);
This works!
|
|
|
|
|
|
So I've been stuck here for 1 week.
Everytime I had problem in SQL connection (ex. someone switch of server) my application will show exception message in a messagebox. I don't know when will the connection available except I keep trying to open the connection / execute a query.
So I create a wait form that will appear if connection is unavailable, keep trying to open the connection, and close itself when connection is available again.
To hide the freeze from user, I use backgroundworker.
This is the backgroundworker code
private void StartLoader(object sender, DoWorkEventArgs e)
{
for (int i = 1; i <= 10; i++)
{
if (this.par.sqSuccess)
{
break;
}
else
{
i -= 1;
}
System.Threading.Thread.Sleep(5000);
}
This is the backgroundworker progress changed event
this.cnn = new SqlConnection(this.par.Constr);
try
{
this.cnn.Open();
this.par.sqSuccess = true;
}
catch (Exception ex)
{
this.par.Exception = ex.Message;
}
finally
{
if (this.cnn != null) { this.cnn.Dispose(); }
}
if (this.par.sqSuccess) { this.Close(); }
After everything is complete, I tried to stop SQL service from services.msc, then I try to connect.
The wait form will appear and keep doing its job.
A few second after I try to connect, I start the service again and the wait form did close, success.
This is the problem, when I wait a little bit longer before I start the service again, the wait form still closed, but it takes a while.
After I check everything, it seems like the cnn.open() queue up and the longer I stop the service, the longer it takes for the wait form to close.
I searched google and try to add Connect Timeout=3; behind my connection string, as I'm sure my thread.sleep(5000) won't make them queue up, but still not working.
I need help to understand how this cnn.open works, why this is not working, what happen in this code that makes I got this problem.
While processing the cnn.open(), did my application execute the code below or wait for it?
Any help is appreciated, thank you.
PS :
I use do while sqSuccess == false looping, I changed it to for just now and I know it makes no difference, so ignore it and the i-=1 too.
|
|
|
|
|
You may like to try the OpenAsync [^] method.
Veni, vidi, abiit domum
|
|
|
|
|
It uses System.Threading.Task.
Is it possible if I want to use it with backgroundworker?
|
|
|
|
|
No idea, but I suggest you read the documentation, and try a few experiments.
Veni, vidi, abiit domum
|
|
|
|
|
Oh ok ok.
There are no example of code inside but I will try googling.
Thank you very much.
|
|
|
|