|
Its there a component or class that can be mapped or assigned to a database table and when the table change (insertion, delete or update) fire an event or send a notifycation to tell the aplication about the change
thanks....
|
|
|
|
|
There is SQL Server Notification Services which is a separate installation apart from SQL Server. IIRC, you can use Web Services or MSMQ. It can send notifications based on SQL events or scheduled events.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question:
When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed.
Favourite quote:
In youth we learn, In age we understand.
|
|
|
|
|
Maybe you can use UDDI? We use it to find a webservice..
|
|
|
|
|
It's recommended you do not share the actual remotable library. Use interfaces instead, and share only the interface. For example
public class MyRemotableDll : MarshalByRefObject, IMyRemotable
{
void SomeMethod()
{
}
}
MyRemotableDll obj = new MyRemotableDll();
RemotingServices.Marshal(obj, "obj.rem");
public interface IMyRemotable
{
void SomeMethod;
}
IMyRemotable theRemoteObj = (IMyRemotable)RemotingServices.Connect(typeof(IMyRemotable), "http://localhost:4030/obj.rem");
theRemoteObj.SomeMethod();
Hope that helps.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Judah,
Thanks for the nice solution. I have further question in your solution and it may sound stupid but help me.
When I am using interfaces on client side how the call reaches to particular piece on server where this interface is implemented. I mean to say that this interface may have been implemented in different different areas. I know that to reach particular piece we do registration of server and give right address (tcp/http) on client side but my question is interface is just an abstract thing. How the call from client actually reaches to server. Please help..
Favourite quote:
In youth we learn, In age we understand.
|
|
|
|
|
In addition to what Judah said (which is the preferred way when you have control over development like this), you can also use soapsuds.exe from the SDK to generate a client proxy (for cases when you can't dictate how the remote object is developed or deployed).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
What library do you use to zip up files? I am using java.util.zip and it's giving me some problems.
Everything works fine if WInZip is installed. However if you uninstall WinZip and it uses the Windows default compresser things don't work so well:
the zip file is created but it's empty.
Does anyone know a solution to this problem?
Thanks,
Elena
Here is my code:
<br />
ZipOutputStream m_zipstream; <br />
string filepath = @"C:\Elena\Junk\test\a.txt";<br />
m_zipstream = new ZipOutputStream( new java.io.FileOutputStream( @"C:\Elena\Junk\test\zip.zip" ) ); <br />
ZipEntry currententry = new ZipEntry(filepath);<br />
currententry.setMethod(ZipEntry.DEFLATED);<br />
<br />
m_zipstream.putNextEntry(currententry);<br />
<br />
try<br />
{ <br />
java.io.FileInputStream current = new java.io.FileInputStream(filepath); <br />
try<br />
{<br />
sbyte[] buffer = new sbyte[8192];<br />
int buffercount;<br />
while ((buffercount = current.read(buffer, 0, buffer.Length)) > 0)<br />
m_zipstream.write(buffer, 0, buffercount);<br />
}<br />
finally { current.close(); }<br />
}<br />
finally { m_zipstream.closeEntry(); }<br />
m_zipstream.close(); <br />
m_zipstream = null;<br />
Elena
|
|
|
|
|
Free one here[^]
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
What is the common practise of updating build and revision number if I want to increase it sequentially (i.e. not using the automatic VS.NET way) for every build? If I increase build number on every build, what about revision number? Does build number and/or revision number ever get reset to 0?
|
|
|
|
|
This project here on CP does that automatically (add-in for VS.NET I believe)
|
|
|
|
|
Hello everybody!
I've written a JavaCoder. With this program I can create,edit,... my java source files. I have even been able to highlight the syntax ( like in Visual Studio. NET ).
Now I've got a question:
How can I make a code-completion?
I use a richt-text-box to edit my files.
Can anyone help????
Thanks
petermax2
|
|
|
|
|
petermax2 wrote:
I use a richt-text-box to edit my files.
Not the best choice of editors. You spend more time overriding functionality than just doing a code editor from scratch. There are also many examples out there (see http://www.gotdotnet.com/workspaces[^]) that could give you some hints.
How do you get command-completion to work? For languages that support it, you use reflection (which Java supports). When you hit the member separator (typically "."), you reflect (and cache, if you haven't already - which is a good idea) the members. I assume you're doing this in C# since you're in the C# forum, so you'll need to use a native JNI DLL and encapsulate that in a managed class. Click "My Articles" in my sig and see my Java/.NET article for a discussion on that. See the JNI docs on Sun's http://java.sun.com[^] site for more information about using Java classes from C/C++.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
Not the best choice of editors.
What else can I use?
Regards
|
|
|
|
|
As I mentioned, right your own or borrow ideas appropriately from vast numbers of examples out there on the web. I even gave you a link to the GotDotNet workspaces where you'll find many examples. leppie - another regular on CodeProject - replied below that he's been working on one. There are tons of examples - just do some research if you don't know how to write a text editor.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
You spend more time overriding functionality than just doing a code editor from scratch.
Exactly what I have been doing the last 3 months, doing a custom rendered code editor. Still needs some work, but its almost done.
top secret
|
|
|
|
|
How did you start?
Can you give me some ideas?
Oh, and what means this:
leppie wrote:
top secret
???
Regards
|
|
|
|
|
petermax2 wrote:
How did you start?
I started thinking it wouldnt be more than a 1000 lines. Its 7000+ now! Most of the time was spent designing and developing fast algorithms to replace known slow operations. Thanks to my design, adding a new language hilighting scheme is a breeze (not always, need to make it better still), and it currently supports 5 langauges: C#, C, MSIL, Nemerle, and XML (beta).
petermax2 wrote:
Can you give me some ideas?
I'm going to be releasing the source under a GPL/LGPL license within the next 3 months.
Some ideas you mite wanna ponder on if you cant wait:
- Write down your goals and get the big picture on paper and stick to it. If you change it, start from scratch.
- Design, design, design (you can never be too sure).
- KISS, think how things exponitanally can affect future dependant operations.
- Fimiliarise yourself with how painting and clipping is done (a new article on CP is very informative on some painting stuff). Know the limits of related Drawing objects (like the maximum area of a region).
- Modularize all aspects, but keep them tighly integrated so information is not required to be duplicated. Memory and speed are your biggest enemies!
- Dont write any code until u know exactly what your design spec specifies and that it is known to work correctly. Run simulations in your head.
- DO NOT look at SharpDevelops attempt. It was a good design ruined by terribly sloppy coding.
- Think how things can be speeded up. eg you have a big file and you are near the end of the file, it will obviously be better to do calculations from the end (or even some nearer known point).
Now that I have scared you enough, I think a small wait will be worthwhile
petermax2 wrote:
???
It's meant to be an IRC link. Install mIRC!
Feel free to ask anymore questions.
top secret
|
|
|
|
|
leppie wrote:
Now that I have scared you enough
I'm not scared about this. I know that I can't write a code editor on one day.
You said Sharp Develop! I've got an idea! Is it possible to use components like CodeEditor,Windows Forms Designer from the Sharp Develop components?
Thank you for the information you gave me!
|
|
|
|
|
petermax2 wrote:
You said Sharp Develop! I've got an idea! Is it possible to use components like CodeEditor,Windows Forms Designer from the Sharp Develop components?
Its possible, but I can gaurentee you that you will be pulling your hair out, fixing bugs, and trying to understand someones idea of logic. Also there codeeditor component is a huge memory hog. My control uses a fraction of the memory used by the former. Try loading a big file in it say about 10mb, it will use close to 300mb of memory, where mine "only" use about 70-80mb.
Well if you decide to go for it, good luck!
top secret
|
|
|
|
|
Hello,
Can I install my service manually not using some kind of installutil.exe or install visard. May be I can connect to the SCM and install my service like I can do this under C++?
Regards
Alex
|
|
|
|
|
The ServiceController doesn't support the installation of services. You can use the AssemblyInstaller class, though, to load your assembly and run the installers in it. See the class documentation in the .NET Framework SDK for more information and an example of using it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am receiving ArgumentException: "Must specify value for source." But I specifying correct path to the assembly. What is the problem.
IDictionary mySavedState = new Hashtable();<br />
try<br />
{<br />
string[] commandLineOptions = new string[ 1 ] {"/LogFile=example.log"};<br />
System.Configuration.Install.AssemblyInstaller myAssemblyInstaller = new <br />
System.Configuration.Install.AssemblyInstaller( Application.ExecutablePath , commandLineOptions );<br />
myAssemblyInstaller.UseNewContext = true;<br />
myAssemblyInstaller.Install( mySavedState );<br />
myAssemblyInstaller.Commit( mySavedState );<br />
}<br />
catch (ArgumentException e)<br />
{<br />
string s = e.Message;<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine( e.Message );<br />
}<br />
This code calling from service project to install itself
|
|
|
|
|
I threw together a simple example using the following code and it worked fine:
static void Main(string[] args)
{
if (args.Length > 0)
{
string[] rest = new string[args.Length - 1];
if (rest.Length > 0) args.CopyTo(rest, 1);
if (string.Compare(args[0], "/install", true) == 0)
{
Install(rest);
return;
}
else if (string.Compare(args[0], "/uninstall", true) == 0)
{
Uninstall(rest);
return;
}
}
ServiceBase.Run(new Service1());
}
static void Install(string[] args)
{
AssemblyInstaller installer = new AssemblyInstaller(
typeof(Service1).Assembly.Location, args);
IDictionary state = new Hashtable();
try
{
installer.UseNewContext = true;
installer.Install(state);
installer.Commit(state);
}
catch (Exception e)
{
installer.Rollback(state);
Console.Error.WriteLine(e.Message);
}
}
static void Uninstall(string[] args)
{
AssemblyInstaller installer = new AssemblyInstaller(
typeof(Service1).Assembly.Location, args);
IDictionary state = new Hashtable();
try
{
installer.Uninstall(state);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
} While Application.Location should return the correct path, it puts a possibly unnecessary dependency on the System.Windows.Forms.dll assembly. If you don't need to reference that assembly, just use Assembly.Location instead (there's many ways to get the current assembly, I just got it from the Type).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you,
I can see my mistakes now. But I have one more question: the code you write will install assembly as what? I cann't find service in Services applet with DisplayName of my service.
Regards
|
|
|
|