LizR 171 Posting Virtuoso
ddanbe commented: The solution to a question is sometimes a question! +2
No, thats not how it works, I guess your F1 button must be broken
No, thats not what you did
You said an equivelent of
Tree of apples = 1 apple.
I guess you havent looked on how you use lists.
You could use objects but your list of medicines should work..
Ok, heres a hint.
If you went into a shoe store, you'll find trainers, boots, shoes and sandals.
Now, they all go into shoe boxes
Same is true with your list, your list will hold your medications, however, you need to check the box as to which type of class you actually have in it.
So, once you've tested what class it is, you can then assign to an appropriate class, or, force the code to run as the class you found it to be so you can see then the additional attributes.
Why not just do the writeline of body you read from the second file?
exactly but Im not sure shouting enable would be loud enough.
I dont think he wants it hidden, but disabled.. but its not like you havent told him the right thing, it would just seem the opposite of disabled isnt the same the world over.
You mean disable it..
(see if thats a big enough hint)
Well what have you tried so far?, sounds simple enough. What exactly are you stuck on?
The answer would normally be you shouldnt.
Please explain a little more of what you're trying to achieve before we can give you better answer
To learn more about String.Format - press F1 on it, it has examples and a lot of information on other formats and how to use it.
Then it sounds like a timing issue.
You probably need to go give the object time to start before sending it instructions
Just google c# threads and look for msdn
Please dont forget to mark your issue solved.
Odd, it should give you a link to your help setup for VS ..
The article I posted was about background threads, and updating the UI and how to go about it, the rules and gotchas of the whole event.
If you're calling an update of your form from within your thread, and the work is done from the thread - not the main UI thread then, you can/will get issues of locking up - wether you use locks or not.
Did you read the thing on threads?
Well with the questions per day thing you could dump their previous count each morning at midnight.
It seems to me more a logic issue than a specific language issue.
Your background thread would need to invoke the main thread to update and draw. Any secondary thread must not update the UI as it can/will cause locks.
To restrict questions to x per day, or hour or whatever means you would have to log someones efforts.. or you select x questions that may run in a day and then randomize.
No, because if as you say the background worker works constantly irrelevant of the form being visible or not. Then the thread shouldnt ever be started or stopped accordingly. Only on creation and termination.
Well it most certainly wont help it.
Try setting the event on the creation of the worker, and never again
cool - please mark your thing as solved
The reason I asked is every time that clicked functions called its going to add another copy of the event so you could end up with the same function called multiple times per event.
no you dont need to install a new OS, whats most likely is that either the db is not the same and has other fields or such. Get hold of a copy and check things like casing on the field names, additional fields, maybe even changes such as different field types.
regional settings
well you wouldnt see much in access except a new row in your table assuming it didnt violate any key restraints.
next question is is that a line that worked or fails?
Have you determind any data entry specifics for when someone adds a line that fails?
The file wont be at \\webpage\blah.htm, its at c:\webpage\blah.html
the \\something notation usually means machine name, is your PC really called "webpage"?
Try putting your slashes round the correct way, eg
file://webpage/whatever.html
Still so many questions..
How do your background processes know not to work?
How is that clicked code running
Where did you do the adding of the delegate?
Whats in "MyEvent()"
IMHO you could do better to change how you've done your data string, because all the " and ' marks and then the gazillion + marks do make it hard to read. Especially where you have things like ","+"'','"
What id suggest is rather than RUN that code, place it into a text box, and place an example of the SQL to run in a message as I think you maybe missing some ' marks
Then post your table definition, and your c# insert code.
You already are, because it creates it as it sends it.
Well either somehow when you think youre closing the form the forms actually closed and gone, or, your still missing some of the thread handling..its hard to say with the code given.
String builder can have advantages when buidling up output. So instead of a ton of
s += titletext;
s += "\r\n--------";
etc
you can just do
sb.append(newtext);
sb.appendline("---------");
it acts almost like a buffer, however if you've done much coding before it does feel unnecessary and isnt the way your brain is used thinking.
most cookies have a default expirey.. Any currently set cookie will keep its old expirey by default too.
You should check for invoke on any UI component. its a good practice to get into so if you then do thread off activities you dont have to redo all your UI code. So, wether you're changing the position of a progress bar, the caption on a button, or even enabling/disabling, anything which belongs to the main thread in effect should be carefully done, as not doing so causes clashes.
UI = User Interface
normally for example, if I were writing an app that was going to do anything of value, I have update routines on my form so that other things can send it data, and irrelevant of wether those things are threaded or not, my form sorts out the update. This is done through delegates.
You often run into issues as the UI cant be updated from anything other than the main thread - so if for example, you have a progress bar and you're working through a long CSV file verifying it, and loading data, and so on, you would call the updateprogressbar function which then checks if an invoke is required and then if it is, it invokes the main thread to do that job, otherwise it does it.
OK, I dont see any thread handling in your code to check for the fact a UI cant be updated by anything other than the main thread.
I also am a little confused as to the Form2(0) and Form2(1) Im not sure what these parameters are for.
This is the bit that worries me
Form2 form1=new Form2();
Form2 form2=new Form2();
Form2 form3=new Form2();
if your worker makes those forms then how is it sure which form its using?
I believe the issue must be how you are assigning your forms to the worker threads (as hinted above).
However, you may need to take into account that your "form2" is not being reset each time, so, when it is reshown, it was at the end of whatever it was doing - this can have bearing as your logic may not have allowed for that.
Depends a bit I guess on what exactly is being done in the background and how you've passed the forms reference to the worker thread so it knows which form to update.
Well.. Generally the cookies created when they login, so you'd probably have to log them in. I dont know - ask the owner of the site
If server side the cookies only valid 30 days, you would need to make them go through the process to generate a new valid one
What does the exception say?
Have you allowed for redirection? Eg if you went to www.somesite.com chances are http is telling "hi thats nice for you, now ask for say index.html"
Sure thats your IP address and that you dont have a dynamic one? On changing your code to be my local IP and dropping the chat client part as it was a test, and putting in a simple receive, acknowledge and disconnect.
I believe if you call iexpore with "-new" and then the url so it goes "iexplore -new http://blah.com" it should work.
Does it have to be IE? If you just run the link as a system call, it will open the default browser.
Well.
You did a foreach which was probably right but then didnt use the link that you had. You'll probably slap yourself if you had looked more closely at what was the object of your foreach loop.
Hint: Look at the original code, it echoed out the URL right? in a STRING form..
Second. You then make up some stuff and pass a list of links to a function that takes a string. So, it wouldnt compile - but then lets assume you work out my first hint and changing it to the right thing.
You need to check the return value of the testurl to do something..
Hint 2: You need to turn a true/false to failed or succeed.