|
I suggest a WebService running on PC B and the Windows Service on PC A can access it to store its data.
|
|
|
|
|
Hi PIEBALDconsult and thanks for the quick reply.
Why would you want to put middleware between the agent and the SQL backend (if that's what you mean). Surely writing straight to SQL would be more efficient?
|
|
|
|
|
Because every time I write an app that directly connects to a database I have to rewrite it to use a Web Service.
There are all sorts of good reasons to use a Web Service, but I don't feel like trying to think about it right now.
CCodeNewbie wrote: more efficient
There are more important issues at hand.
|
|
|
|
|
Hi ,
I am writing a code to get the assembly version of an exe exists at C:\program files\xyz\xyz.exe.
private void button1_Click(object sender, EventArgs e)
{
try
{
MessageBox.Show(FileVersionInfo.GetVersionInfo(@"C:\Program Files\XYZ Software\XYZ Enterprise 1\Client\XYZ .WinForms.App.exe").ProductVersion.ToString());
}
catch(Exception ex)
{
MessageBox.Show(ex.Message +"--" + ex.StackTrace);
}
}
Its showing correctly when executed in my system like 7.1.0.22 . But the same code executing at Server 2008 its not working fine. its raising exception. May I know how to get version .
Thanks
|
|
|
|
|
Maybe read what the exception says, and adapt your code accordingly.
|
|
|
|
|
My guess is that your application is running into permission issues. You need to read up about the new security model introduced with Windows Vista and above, and see what effect that has on your code.
|
|
|
|
|
That exe is in "Program Files (x86)" on a 64bit server, isn't it?
Yes - No - Cancel - FileNotFound ...
|
|
|
|
|
I've got 2 tables (Components, Servers) with a many-to-many relationship and hence a 3rd table (ComponentServers) connecting the two main tables.
I've created a DataSet and bound WinForm to show and edit this data, but I can't get it to work if there's no data already there. i.e. UPDATE works but INSERT doesn't. I've checked the SQL and that *looks* ok.
The insert is:
INSERT INTO ComponentsServers (ComponentID, ServerID, Environment)
VALUES (@ComponentID,@ServerID,@Environment)
The update is:
UPDATE ComponentsServers
SET ComponentID = @ComponentID, ServerID = @ServerID, Environment = @Environment
WHERE(ComponentID = @Original_ComponentID) AND (ServerID = @Original_ServerID) AND (Environment = @Original_Environment)
On the form I've done the binding via controls not code, and the ComponentServers BindingSource does reference the related ComponentServers table in the DataSet and not the standalone one.
In the save button I've got:
this.Validate();
this.componentsServersBindingSource.EndEdit();
this.componentsBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.eSSDBDataSet);
The form works from a presentation point a few, and as I said, if I update a exisiting entry. But if there's no row in ComponentServers I can't get it to work.
Any clues as to where I've got it wrong? I *think* its the DataSet, but not sure why!
|
|
|
|
|
while Remote Oracle Database connection, mentioned exception coming
ORA-12154: TNS:could not resolve the connect identifier specified
I installed for client side OracleXEClient software for accessing. How can i solve these problem?
--Thanks
|
|
|
|
|
There looks to be some issue with 'tnsnames.ora' or Oracle install directory (ORACLE_HOME).
also look at this link[^], if it makes sense.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
Hello all,
I am very new to Visual Studio and C#, and have just now decided to try it out, after years of "casual" development using Delphi.
I have a simple question that I just can't find an answer to; Namely, how to install additional classes, for example downloaded from here.
The class I'm trying to install is this one;
XML configuration files made simple... at last![^]
The zip-file contains a dll-file and a few xml-files. I would really appreciate some help about where to put these files, as it is totally different from installing components in Delphi.
I am using Visual C# Express 2010.
Thanks very much in advance!
Daniel, Sweden
modified on Monday, September 19, 2011 3:08 PM
|
|
|
|
|
(Btw, I'm a bit surprised by the fact that there is no simple "wrapper" for saving/reading data from xml-files, something like TIniFile in Delphi. I've experimented a bit with "Applications settings" which seems really great, but I would like to have mote control of how the xml-file looks, where it is placed, etc.)
Please don't let this rant overshadow my original question.
Thanks again!
Daniel
|
|
|
|
|
DanielCrk wrote: I'm a bit surprised by the fact that there is no simple "wrapper" for saving/reading data from xml-files
You should be, as your gut is right - the wrapper is called XmlSerializer[^]. Simply wrap it in a method and use it to go from object->XML and back. Also works on collections
DanielCrk wrote: something like TIniFile in Delphi
Prefer XML, as it has better support for handling data and validation.
DanielCrk wrote: I would like to have mote control of how the xml-file looks, where it is placed
Serialize to a MemoryStream, not to a FileStream; you'll be able to manipulate it all you like, before saving the string to a file.
Bastard Programmer from Hell
|
|
|
|
|
Thanks Eddy, I'll definitely check that out. I finally figured out how to include and use "external" classes (alot thanks to jschell) and tried out the one I referred to in my original post, and it seems to be working exactly how I was hoping. So I'll compare the two and see what fits me the best.
I really appreciate your input, and it looks I'll be visiting this forum again! =)
/Daniel
|
|
|
|
|
DanielCrk wrote: Thanks
You're welcome
DanielCrk wrote: it looks I'll be visiting this forum again! =)
Yeah, me too
Bastard Programmer from Hell
|
|
|
|
|
In visual studio you would be working in a solution.
A solution can have one or more projects in it.
A project, in the Explorer view (think that is what is called) each project has 'References' under it.
You can add a dll to 'References.'
As for the xml files there could be many places to put them. But you could
1. Put them in the root where your .cs files are.
2. Add them to the project via right click and add existing.
3. Right click each xml file, select properties and then under 'Copy to Output...' make a selection.
|
|
|
|
|
Got it working, thanks alot!
/Daniel
|
|
|
|
|
I have a C#.net 2008 desktop application that uses some third party software. Since the third party software venfor went out of, I can not ask them any questions about their code. Due to this fact, I have the following questions:
1. I know these third party components had to of been added as a reference. However, can you tell me if there is a way to tell how these third party components were added to the application? For example, could these components have been added as COM, .net components, and/or browse to a location?
2. If I want to remove any of these third party components from this visual studio 2008 C# desktop application, can you tell me how I wouldremove these items?
|
|
|
|
|
1. It's not very easy to see how they were added, but if you check the properties of the Reference entries within your project then that should give some information about their location.
2. You need to decide first what will happen in your application if you remove them; will it still run or crash?
|
|
|
|
|
C# references additional items:
1. I looked at the properties for each third party component and found all 6 items are file type 'assembly'. Is there any way for me to tell if they were an added reference to the solution as a '.net', COM, proejct, or browse items?
2. If there any way to tell if these third party items are required or not? The only thing I can think to do is just remove one item at a time and see if the application still is running.
|
|
|
|
|
Absolutely. Assembly means they're .NET. Remove them, and if they're needed its very likely that you'll end up with compile errors. The exception to this is if they are dynamically created at runtime which is pretty unlikely, but delete everything in your bin folder to make sure.
Regards,
Rob Philpott.
|
|
|
|
|
If this code is .net, is there any way I can tell where all the code acutally exists?
|
|
|
|
|
1. I'm not really sure why this is important.
2. If you remove them then the chances are that your application will not even build. You should find out why these are included in your application before taking any action.
|
|
|
|
|
The only way i would determine why they exist, by the code that calls it and the results returned by the code, correct?
|
|
|
|
|
Exactly so, and one would hope the original writer(s) put in sufficient documentation to explain what it's there for.
|
|
|
|