I did mention it would have to map its own :) but it should also have code in case that drive disconnects (such as something goes wrong)..
If your app runs as a service, and is set to autostart, it would run on startup.
I did mention it would have to map its own :) but it should also have code in case that drive disconnects (such as something goes wrong)..
If your app runs as a service, and is set to autostart, it would run on startup.
How did you define the MyEvent type?
the UpdateText method looks reasonable, it would seem more likely it didnt get called.
No, you can have a large number of threads running at any time, although actual activity is limited and timeshared over the available CPU power of your box.
eg, if you have a single CPU with HT - thus pretending to be 2 CPUs directly technically it does only 2 things at a time, however with fancy timesharing by windows it will appear more than 2 threads run (for example take a look in task manager and see how many processes there are, let alone if you use something like sysinternals process explorer and see how many threads per process)
OK, as a rule a service should not make windows or write to consoles - as a lot of the server versions of windows are either set not to, or dont by default allow it
Other things to remember when making a service is that if you as a user map a drive, the service cant see it, even if it runs "as you" .. it has its own instance, and wont see any mapped drives, it should do its own.
As you're making some form of net monitoring system, a text file is possibly not a good place to keep things, as the more servers you get the more likely you are to run into file locking issues.
The key facts are however, for all the threads you start you must terminate them.. and handle any issues within them.
OK, so now Ive eaten my dinner - and I got 30 mins before I go out:
Picture this.
You have a routine on your first form, which you assign to an event on your second form - such as a routine like:
public UpdateText(String msg)
{
this.textBox1.Text=msg;
}
If your event is programed to receive such a thing, you could easily on creation of your second form do
form2.MyEvent += new MyEvent(UpdateText);
then within form2, on clicking of button you can test
if (MyEvent!=null) { MyEvent("testme"); }
and you just triggered your event..
another way to do it is to have
void DoMyevent(String msg)
{
if (MyEvent!=null) { MyEvent("testme"); }
}
and then when you potentially need to call your event do
doMyEvent("sometext");
and your code is easier to read
Just read up on delegates and events.
have you considered setting a property on form2 to be the value of form1? so you have a reference?
You can either make an event on your main form which you tie into the button on your second form (messier)
or
You can create a method which you send the data from your second form, to your first form. So the first form handles all its updates.
You said it wasnt working - it cant be good enough if it doesnt work, can it?
So, your new code, how about letting us have the error code you get, rather than trying constantly to recreate half an application to duplicate the need for the code you have?
I think your stored procedure needs more tweaking - the info can be found at .. http://msdn.microsoft.com/en-us/library/bb546186.aspx
The problem would seem to be
return ((int)(result.ReturnValue));
In old days thats probably a pointer to the result, but in .net youve told it to be an int, so an int it is.
Try changing it to
return ((IEnumerable<Order>)(result.ReturnValue));
If your exchange server supports SMTP mail connections (which most likely it will) you would just change your app to point to your exchange server
Dunno I never asked a question here, I assume theres a button to say "resolved" somewhere.
if you look at:
until (call_start >= 0) or (call_start <24);
repeat //repeat 2
writeln ('please input call length');
readln (call_length);
until call_length > 0;
You have an until without a repeat. Hence you get a confused bit.
Learn SMTP its really easy.
OK but you're reinventing the wheel thats already included in the smtp which comes with .net
It shouldnt do not in the database you selected it from. Assuming you have indexes 30k records should be processable in a matter of 1 or 2 seconds.
Im thinking your selection code needs tweeking as the DB should do the join, which is why its slow.
it should go something more like
str1 = "
select * from dbo.Executive inner join Retailer on Executive.ExecutiveCode = Retailer.salesExecutiveCode"
which should join your 2 tables in 1 big grid, if you then only need 1 value such as retailercode, then add the "where RetailerCode='00000949'" to that original selection..
Not only have you then only downloaded the records who matched the criteria, you've made the potentially remote server do all the work not your app.
Didnt really answer my question, are you talking pop, exchange, imap, smtp? If so, next to all thats already premade..
what do you need your library to do thats not covered?
depends what you mean by mail library. a lot of commands are made for you and built into the frame work.
why not just do a joined query on the server, its much more efficient
What errors do you get? Id suggest make a new winforms app, apply the code there, and if that doesnt work, please post all the code so we can see, as well as the errors if any.. If there are no physical errors, please describe what you're seeing (or not seeing)
Perhaps you should add rows to your D1 dataset?
unfortunately ping is often blocked and is also the loweest priority of network traffic, its the first thing to die. Round trip time isnt a good judge as just coz its closest doesnt make it fastest.
Kil the whole application doevents bit, thats a sure way to tie yourself in knots.
Have a list items you've queued up to go, fire off 5, as each of the 5 finish, take the next one off the queue and start a new thread. until you have nothing left in the queue.
At the end of each threadrun, issue an event to say "A thread finished, heres the result" ..
download a test file and compare times?
Doesnt make any difference. Most likely your desktops on drive C anyway.
Good example comes in the help, just look at Console.ReadKey
Ah you mean to minimize not close.. now it makes sense.
or use the readkey function and while its not Y or N.. keep reading.
Would not the row index be higher than the record count?
I showed you that code.
I see what you mean in someways, however, either way you end up with some kind of loop.
if you wanted to change your code so you dont do something like
if (textbox_from_1.Text == textbox_to_1)
if (textbox_from_2.Text == textbox_to_2)
if (textbox_from_3.Text == textbox_to_3)
etc, you would still end up with a loop
i guess you have tried the obvious of such as :
for (int i = 1; i<3; i++)
{
if (TextBox)Controls["textbox_from_"+if.ToString()].Text == (TextBox)Controls["textbox_to_"+if.ToString()].Text)
}
Well, it depends a little on how you made those boxes, if they are premade on your form, then you'd know the names before you started.
if they are generated, you could make an array of textboxes, and just walk the array of text boxes..
in a way all c# stuff is pointers as everything (including integers etc) are objects, but at the same time, you basically ignore that. So yes, it can be confusing from a c++ point of view.
Firstly if you did a correct selection from the db, it would return 1 line that matched or 0, it shouldnt do it for all users in the db.
Secondly, if you created a flag to equate to "found" or "not found" you could then deal with it at the end. So even if you did have multiple entries loops through for some odd reason, you would only display one message.
OK so when the location changes, clear and populate the floor combo with items that match.
Sure walk through all the components of a form checking to see if their of type textbox.
Create a boolean variable, thats a "flag" as its yes or no.
If you dont enter any it doesnt find a record in the db so no it wont show a message (debugging would show you this as the records returned would be none)
set a flag at the top of the routine to false
if you get a valid login, set it true, if its still false when you get to the bottom then they didnt have a valid id
You dont need to send I at all.
heres some psudo code
begin
split string get bunch of chunks
define output area
dostuff(chunks)
end
proc dostuff(chunks)
take first chunk
for all the bits of last chunk
for all the output areas
make a copy of current output area + bit
dostuff(chunks - current chunk)
end
So, you need to split the string into chunks and work by value, and then go from 'start' to 'end' for each one.
You havent explained the problem of the last row, the reason I wonder about -1 is becaue of the 0 based array/list properties.
What is the error you get? Is there any other code you have around that line?
Sure you want RowIndex? not RowIndex - 1?
Whats the error and did you really need to spam so many different questions, as they are all based around the same subject.. you could have placed them 1 by 1
usually its ^H or ^? but not always they often are backspace, best way is to grab all characters on a press and see what you get - although it would seem a bad way to test for a delete key
and at which line (just to be sure)
Why not? what error does it give?
Surely it has an equivelent of "My documents"?
As long as the lines are unique you would need to either use a dictionary and sort an array/list of those characters being the key to the dictionary, OR, you need to write your own sort routine.
I dont see why you'd be having a problem the following
List<String> lines = textBox1.Text.Split('\n').ToList();
lines.Sort();
textBox2.Text = String.Join("\n", lines.ToArray());
With
"a cat
a bat
a mat"
put into textbox1, sorted it correctly
Have a read on IDisposable - that will cover the disposal comment
The stringlist would be part of your new class you made from IDisposable, so that when it goes you can itterate through the things you need to do..
You then add to the list each time you change the image reference, to place the old unwanted item on the list for removal when its all over.