|
It's a bit grim, but if you're on Sql Server 2005, you can write managed stored procedures in C#, so you could use some mechanism like Remoting to send an update from your managed proc to the listening process. You'd then need to link your managed proc into the trigger.
As far as monitoring file changes, the following code snippet may give you some pointers:
using System.IO;
_watcher = new FileSystemWatcher();
_watcher.Path = folder;
_watcher.IncludeSubdirectories = true;
_watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.DirectoryName | NotifyFilters.FileName;
_watcher.Changed += new FileSystemEventHandler(OnChanged);
_watcher.Created += new FileSystemEventHandler(OnChanged);
_watcher.Deleted += new FileSystemEventHandler(OnChanged);
_watcher.Renamed += new RenamedEventHandler(OnRenamed);
Regards,
Rob Philpott.
|
|
|
|
|
Thanks for your reply.
Rob Philpott wrote: Sql Server 2005
we use MS Sql Server both 2000 and 2005
Rob Philpott wrote: managed stored procedures in C#, so you could use some mechanism like Remoting to send an update from your managed proc to the listening process. You'd then need to link your managed proc into the trigger.
I didn't know about 'Managed stored procedures', can you give me more information about this?
|
|
|
|
|
Hi,
I worked out a decimal value and return the value like this:
return objWine.CurrencySymbol + (decUnitPrice * intQty);
But the it will display something like:
$100.0000
How do I format this number to display $100.00, and will this function round the decimal numbers?
I hope someone can help.
Regards
ma se
|
|
|
|
|
|
|
try
<br />
decimal d = 100.0000m;<br />
string s = string.Format("{0:000.00}", d);<br />
Console.WriteLine(s);<br />
the result :
<br />
100.00<br />
|
|
|
|
|
This doesn't display right:
String strUnitPrice = String.Format("{0:#,##0.00}", "100.3456");
I want it to round it off to 100.35 (rounded), but it just displays 100.3456.
What am I doing wrong??
|
|
|
|
|
It should be:
<br />
String strUnitPrice = String.Format("{0:#,##0.00}", 100.3456);<br />
no quote, it must be a number.
And I would suggest you read the reply above mine.
There are more information about String.Format.
or search in on MSDN.
hoping this help.
|
|
|
|
|
Yeah I did just that and worked, but thanks any how!!
Cheers
|
|
|
|
|
Hi,
Get the value in a string and use System.Math.Round(x,2).Tostring();
Thanks,
Mirunalini
|
|
|
|
|
Dear All,
I am doing a project which needs to load different "child" Forms in a specific area in the Main Frame Form.
I tried to create a "child" Form instance inside the Main Form, and every time when Main Form move, it will update the "child" Form's location. But by using this method, the Form keeps flickering even "double buffering" is already enabled.
I am thinking that if it is possible to create a ControlContainer that can load the Forms accordingly, but I am new to C# and not sure what should do.
Anyone knows can please point out which area I should read or any place has the existing sample can refer?
Thanks a lot!
Best Regards,
Jacky Ha
|
|
|
|
|
I suppose your's is the fit case of MDI application. Set ISMDIContainer property of the Main form to true and load child forms as MDI Child
|
|
|
|
|
Hi, KrunalC,
Thanks for your reply!
Yes, this method can work if the Main Form and Child Form are standard ones.
In my case, the Main Form is a shaped Form (using Background Image and Transparent Color), so if set IsMdiContainer, the previously transparent Form Edge will have an edge now.
Another issue is that I only need a specific area in the Main Form to be able to load different "child" Forms. If set IsMdiContainer, it will apply to the whole Main Form. Is there any method to set its size and starting position?
Thanks again!
Best Rgds,
Jacky Ha
|
|
|
|
|
Do your child forms really need to be forms? Probably UserControl s or maybe even simple Panel s will be more suitable.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi, Stefan,
You are right! I will try Panel first and then UserControl if Panel can't.
Thanks a lot!
Best Rgds,
Jacky Ha
|
|
|
|
|
Well!, i think if u made the main form MdiContainer and then make the other child forms childs for the main form u can get wat u need
here is wat u have to do
First for the main form "parent form" make the property
mainForm.IsMdiContainer = true;
and b4 u show the child forms u have to put this lines of code
childForm NewMdiChild = new childForm();
// Set the Parent Form of the Child window.
NewMdiChild.MdiParent = this;
// Display the new form.
NewMdiChild.Show();
i hope it helps
good luck
Keep Prayin
|
|
|
|
|
lo,
i want to change a cell constantly for example
for (int i = 0; i < 100; i++)
{
// the shown value of a certain cell, say column 1 row 3, is i
sleep 100; not sure about this either
}
so in the datagrid in column 1 row 3 i see a nr counting up to 100
and i dont want my datagrid to shake
anybody tips?
thx
|
|
|
|
|
Hi All,
I should write a help for my application in C#.NET at the command prompt.
And the format at command prompt should be
sample.exe /? or sample.exe/?
Plz provide me the code to write this and i should show some help abt what that appliaction do when i press sample.exe/? at command prompt..
Plz HELP!!
|
|
|
|
|
Change your main method so it looks similar to the following code snippet:
static void Main(string[] args)
{
if (args.Length != 0)
{
for (int index = 0; index < args.Length; index++)
{
if (args[index] == "/?")
{
return;
}
}
}
else
{
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
the parameters of the Main method are "string[] args".
that means that you receive the arguments the user gives you in the command line (arguments = the words after sample.exe).
if you want to check if you received /? in the command line, simple check what is the string in args[0].
if(args.Length > 0)
{<br />
if(args[0] == "/?")<br />
{<br />
}<br />
}
|
|
|
|
|
Thanks Stefan and Green!!!!
Both are working fine!!
|
|
|
|
|
I can get the current application window handle using the API
GetForegroundWindow()
From this handle I can get the caption of the window using the API
GetWindowText()
But, I need to know the name of the application that this window belongs too. Please help
thanks in advance.
|
|
|
|
|
|
Thanks for that. Unfortunately it seems to bring back the name of the c# process that im running and not the currently active process/window. Or am I missing something?
|
|
|
|
|
Hi,
Having searched the web without a conclusive answer I hope someone can advise.
I need to print an already created word document and at the same time set the printer name, tray, page orientation etc... for the printer the document is to be printed to.
I have used System.Diagnostics.Process... however this does not seem to allow the setting of the various printer items mentioned above, but does allow the printing of an already existing document.
System.Drawing.Printing does allow the setting of all these items but does not seem to allow the printing of an already existing document.
Microsoft.Office.Interop.Word seems to allow the setting of some of the printer settings but in a slightly different format (eg: setting the tray for page one to be different than for the rest of the pages is not quite what I want. I need to set the tray for document 1 then a different tray for document 2).
I am being led to believe from the MSDN forums that word documents can only be printed via the Microsoft.Office... libraries. Can anyone confirm whether that is true.
If it is true then am I missing something in the API because I would like to do the following:
Print Document 1 using tray 1
Print Document 2 using tray 2
However the API seems to only allow the following:
Print Page 1 of document 1 using tray 1
Print the rest of document 1 using tray 2
Print Page 1 of document 2 using tray 1
Print the rest of document 2 using tray 2.
Is this correct or can someone please advise/assist
Thanks in advance Andrew
|
|
|
|