|
|
Cool. I never knew this. Wonder what the point of it is
Simon
|
|
|
|
|
It might help to get lines aligned. I have never used it though.
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
Go to the 'Edit' menu, select 'Advanced' and then 'View white space'. This enables and disables the dots.
|
|
|
|
|
Hi all,
I have created one windows services in C#. In OnStart method i want to start external exe at particular given time by user.
For that i need to keep comparing time of system and user given time.
But OnStart method calls only one time when starting that service.
Is there any other event or methods which will call continuosly when service in Started condition.
I feel happy when will get alternative solution for the problem.
Thanks guys......
|
|
|
|
|
Create a global Timer instance like System.Timers.Timer or System.Threading.Timer in your service class that you enable and start in your OnStart() event. Then every time the timer event fires you can perform your logic you need to. And you can set it to fire as often as you like.
Hope this helps.
|
|
|
|
|
Hi,
You could place a timer control on your service and do your programming logic in timer elapse event. Set the timer elapse time say 10 seconds or what ever you want and launch your exe.
cheers
|
|
|
|
|
Use a BackgroundWorker object. Timers are okay, but they send the lowest priority message Windows has, and it's not guaranteed to be handled in a busy system. So, to avoid the issue, use a BackgroundWorker.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi All,
I have developed a formbased application.
In which I need to use another dll which contains some callback.
For using the callback inside the DLL from C# application what should be done??
In dll there is a struct which stores the callback pointers and one function uses to register this callback.
Please help
Regards
San
|
|
|
|
|
Have you tried the obvious, i.e. registering a callback method and then calling the method?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi guys! what's up
here is my question..
hi!! i made an application and i want to save into my databae the datas from some textboxes. when i click the save button the datas are being normally or at least that's what i thought...
sometimes tha datas are being displayed sometimes not. for example, i run visual studio 2008 c# at 8 pm. and i can see the datas which i inserted before, i close studio,,, after a while i run again studiio and tha datas have gone....
the code is correct..
Please help me guys, i really need your help.
sorry for my english
|
|
|
|
|
Can we get some sample code so we can try to help?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
sakis24 wrote: the code is correct..
Obviously its not.
From the very poor information you have supplied its impossible to say what is wrong. Do you get any errors when you save your data, do you reload it when your application starts? There are just so many things that could be wrong.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
here is the comands
private void InitializeCommands()
{
//INSERT
dataAdapter.InsertCommand = conn.CreateCommand();
dataAdapter.InsertCommand.CommandText =
"SET IDENTITY_INSERT Producer ON insert into Producer(Pid,AFM,LastName,FirstName,City,ZipCode,Adress) values(@Pid,@AFM,@LastName,@FirstName,@City,@ZipCode,@Adress)";
AddParams(dataAdapter.InsertCommand, "Pid", "AFM", "LastName", "FirstName", "City", "ZipCode", "Adress");
//UPDATE
dataAdapter.UpdateCommand = conn.CreateCommand();
dataAdapter.UpdateCommand.CommandText =
"update Producer set AFM=@AFM, LastName=@LastName, FirstName=@FirstName, City=@City, ZipCode=@ZipCode, Adress=@Adress where Pid=@Pid ";
AddParams(dataAdapter.UpdateCommand, "Pid", "AFM", "LastName", "FirstName", "City", "ZipCode", "Adress");
//DELETE
dataAdapter.DeleteCommand = conn.CreateCommand();
dataAdapter.DeleteCommand.CommandText =
"delete from Producer where Pid = @Pid";
AddParams(dataAdapter.DeleteCommand, "Pid");
}
the add paremateres method
private void AddParams(SqlCommand cmd, params string[] cols)
{
foreach (string col in cols)
{
cmd.Parameters.Add("@" + col, SqlDbType.NVarChar, 0, col);
}
}
the insert button
private void btnAdd_Click(object sender, EventArgs e)
{
insertRec = true;
DataRow row = dt.NewRow();
dt.Rows.Add(row);
//MessageBox.Show(totalRec.ToString());
totalRec = dt.Rows.Count;
curRec = totalRec-1;
row["Pid"] = totalRec;
txtpid.Text = totalRec.ToString();
txtAFM.Text = "";
txtln.Text = "";
txtfn.Text = "";
txtCity.Text = "";
txtZip.Text = "";
txtAdr.Text = "";
btnSave.Enabled = true;
}
and the save button
private void btnSave_Click_1(object sender, EventArgs e)
{
DataRow row = dt.Rows[curRec];
//MessageBox.Show(totalRec.ToString());
//MessageBox.Show(curRec.ToString());
row.BeginEdit();
row["Pid"] = txtpid.Text;
row["AFM"] = txtAFM.Text;
row["LastName"] = txtln.Text;
row["FirstName"] = txtfn.Text;
row["City"] = txtCity.Text;
row["ZipCode"] = txtZip.Text;
row["Adress"] = txtAdr.Text;
row.EndEdit();
dataAdapter.Update(ds, "buffer");
ds.AcceptChanges();
CreateDir();
ToggleControls(true);
insertRec = !true;
}
i havevreated the dataset,dataadapter, the conection string and the datatable of course
|
|
|
|
|
hi
i want to have a password on my database
i tried "databasepassword" but it does not work
i think it just work in "sql mobile edition"
do you have an idea ?
please help me !!!!
|
|
|
|
|
Which database are you using?
|
|
|
|
|
OK - I've 5ed this to counter the 1 you received for not being able to read this morons mind.
|
|
|
|
|
Ah, not worth worrying about Pete. Somebody voted him down, and he assumed it was me etc. etc. etc. It's a whole viscous circle.
By the way, did you ever have a look at that Visual WebGUI thing I mentioned, er..., several months and a different lifetime ago? Looked pretty nifty to me.
|
|
|
|
|
I have a string that looks kinda like this..
Name:Name1/Name2.Name3.Name4
If i try to save using this as the file name it calls it invalid so I need a way to parse through it and replace the illegal characters with ... say.. an underscore _
Can someone help me with this?
tia
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Assuming the variable name holding the string is 'aString',
aString = aString.Replace(@"/", "_");
will do it character by character.
I think there's also a way to replace any of a group of characters, but if so, I can't remember what it is.
|
|
|
|
|
Thanks for this info. Just the kind of thing I needed.
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
|
Martin, you beat me to recommending regex and Expresso. I'll second your suggestion
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Thanks for the info I have been trying to take all this in..
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I need to intercept text being entered into a text box, and remove a space if it is typed. The problem with the following code is that the cursor ends up at the beginning of the string, not the end. Say the user types 'a' and then a space, i want the text box to show 'a' with the cursor after the 'a', not before the 'a'. Is there a way to specify the cursor location?
textBoxA_TextChanged (object sender, System.EventArgs.e)
{
if (textBoxA.Text.Contains(" "))
{
textBoxA.Text = textBoxA.Text.Trim();
}
}
Also, is there a way to supress the TextChanged event happening a second time, since I'm changing the text within the event handler? With a data grid, for example you can do the BeginInit/EndInit. The text box doesn't support ISupportInitialize, correct? Other things trigger off each character that is typed so I need to check character by character.
|
|
|
|