|
See the SQL Server Notification Services[^]. It's designed for these sorts of scenarios.
The only other way would be to create an extended stored proc (xp proc) that the trigger called that would use whatever code is necessary to broadcast or queue your notification message that clients could subscribe to receive (such as using MSMQ or some other asynchronous mechanism - synchronous would not be recommend!).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks I will look into these
|
|
|
|
|
I have successfully created a Invoice programme, but the resultant printed Invoice does NOT align the currency, $, values so that the Cents (0.00) are aligned correctly. Is there a way that, using Graphics.DrawString(), a simple command can be created to position the 'x' dimension at the righ hand end of the currency value?
Assistance is appreciated.
Fred S. Parker
Email: fred@fsparker.com.au
|
|
|
|
|
So long as you only ever have 2 decimal places for currency, you can just set the StringFormat.Alignment property to StringAlignment.Far and then call Graphics.DrawString with that StringFormat .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the prompt reply.
It works, but not perfect.
Is there a method, similar to MS Word Fromat/Paragraph/Tabs/Decimal.
Fred S. Parker
Email: fred@fsparker.com.au
|
|
|
|
|
All that comes down to drawing an on-screen bitmap in the end. Just make sure all your calculations are correct and take any variable-width fonts into account, which numeric glyphs themselves usually are (for this very reason).
There is tab support in the Graphics class and related classes; read the .NET Framework SDK documentation for the Graphics class to learn more.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am using Task Scheduler (which is written in c#) class library by David Hall. I am facing problem when task get executed automatically at given time. The error is coming “Unable to establish existence of the account specified”. When I reassign account password (double click on task under ‘Control Panel/Scheduled Task’) and run manually then it is running fine. The reassign password is same as given at run time. Why I am not able to set password at run time. Any idea…
-Ash
|
|
|
|
|
AsheeshS wrote:
I am using Task Scheduler (which is written in c#) class library by David Hall
You should post your question to his web site, not here.
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
Hello Mazy,
Can you please tell me his web site.
|
|
|
|
|
I don't know it. If it is one of codeproject pages you can search for the author , otherwise use google to find it out.
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
You downloaded his library. Check your history if it wasn't that long ago.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I Think, i am using updated library (updated by Dennis Austin) dated 5 Nov 2002. If it is not updated then please let me know from where i can download updated one.
|
|
|
|
|
Again, you download it and we're not familiar with it. Find and check his site for more information. This forum is for general C# questions and questions about the .NET Framework Class Library. Any questions about specific products need to be asked on the product web site.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all.
I am trying to build the 'Print Preview' sample that can be found in the VISIO SDK samples (under the category 'c# - publishing' in code librarian).
I follow these steps (these steps are exactly the ones indicated in the Microsoft Office Visio SDK Documentation):
quote:
------------------------------------------------------------------------------
In Microsoft Visual Studio .NET 2003, on the File menu, point to New and then click Project.
In the New Project dialog box, under Project Types, click Visual C# Projects, and then in the Templates list, select Windows Application.
Name the project, specify the location where you want to save it, and click OK.
On the Project menu, click Add Windows Form, and name the form PrintPreview.cs.
Double-click the form to open the code window.
Open Code Librarian, double-click Microsoft Visual C#.NET, double-click Publishing, and then click Print Preview.
Copy the sample code, and in Visual Studio, paste the sample code into the PrintPreview.cs code window, replacing the previous code.
On the Project menu, click Add Reference.
In the component list, select stdole and then click Select.
Click the COM tab, select Microsoft Office 11.0 Object Library and Microsoft Visio 11.0 Type Library, click Select, and then click OK.
------------------------------------------------------------------------------
When I try to build it I get an error:
"The type or namespace name 'Interop' does not exist in the class or namespace 'Microsoft.Office'"
This error happens whenever I try to use: "Microsoft.Office.Interop.Visio"
Am I missing a reference? I added the three references indicated in the steps above.
Of course, I installed Visio SDK and also VSIP.
I need for this to be built! What reference am I missing? What am I doing wrong?
Any help will be greatly appreciated.
|
|
|
|
|
You should install the Primary Interop Assemblies for Microsoft Office 2003. If you don't have those installed (and I don't know off-hand if the Visio SDK installs them), then Vs.NET creates interop assemblies for you that probably wouldn't contain the Interop portion in the namespace like that which is included in the sample code.
If you have Office 2003 Professional, these are supposed somewhere on the CD.
What Primary Interop Assemblies (PIAs) are is assemblies created by the vendor (typically) that are associated with the registered, associated COM objects. When you import a COM reference, those PIAs are used instead of creating new ones.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Yes, thanks.
I did so.
Things are better now.
However, I still have a problem with:
AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
Where is the reference to this one?
|
|
|
|
|
What I am trying now is to compile OfficePlanSample (a Visio SDK sample)
|
|
|
|
|
hi,
i want to to hook a certain msg for a window like moving or sizing, this window is standalone app and i have its handle is there any APIS help me do this ?
|
|
|
|
|
If you want too hook your windows messages of your own application implement IMessageFilter interface and inheit your form from it then use Application.AddMessageFilter to add it to your application and do whatever you want with it.
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
no not my own app but an outside app that i have its handle
|
|
|
|
|
You'll need to use a system hook, if nothing more than to inject your code into the other application's process space (since an application doesn't dispatch messages to other processes). See Using Hooks from C#[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi all,
i am writing a program in c#, and i have run into a MAJOR problem.
i have a 'frmMain' class which contains the GUI, and a 'database' class which handles the connection to the database. the GUI class creates an instance of the database class and calls the 'searchdatabase' method, which in turn wants to add items to a list box in frmMain. however, when i try to do this it tells me that an object reference is required . help is very much needed on this topic,
thanks in advance,
thewebmonster
|
|
|
|
|
Okay. It looks like one of your variables is not initialised properly. First you need to determine what is null (in other words what doesn't have an object reference).
A quick tour of some of the debugging features in VS.NET: The watch window and the call stack will come in useful. Re-run your program and wait for it to crash, then you can see from the call stack where the program crashed (you can also navigate up and down the call stack to see what was calling what at the time). In the watch window you can see the values of your variables and objects. Does any of these look like is should contain a value but doesn't. You can also hover over variables and properties in the code window to see their value at the point the program stopped.
If this doesn't work. The next thing you can try is setting breakpoints prior to the fault and stepping slowly through the code watching the variables change and the program execute at a speed you can comprehend. Does anything look like it should happen but doesn't - Like if statements that don't quite work they way you expect etc.
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
it doesn't even compile.
i am using c# builder if that helps in any way possible...
|
|
|
|
|
Did it compile before? From your description it sounded like a runtime error.
If it is C# Builder that is causing this error then I'm not sure I can help as it sounds like the IDE is broken.
However, it may be the C# builder is giving a slightly different error message than VS.NET. What line of code does it give this error for? Have you tried to use a variable before it is initialised?
e.g.
SqlConnection conn;
conn.ConnectionString = myConnectionString; Could bring up an error like this because you create a reference to a SqlConnection object, but you don't actual creat an instance of it. You would need to insert the line
conn = new SqlConnection(); in between the two I've given above for it to work.
Watch out for things like this also:
SomeObject someObject;
foreach(SomeObject currentObject in someObjectCollection)
{
someObject = currentObject;
} because if there is nothing in the collection, someObject could possibly never be initialised and the compiler doesn't like that. The same goes initialisation within any conditional statements. Although it is clever enough if you have construct like if(){...}else{...} with initialisation in both
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|