|
In VS2005 (probably the same in 2008) to get the IWshRuntimeLibrary in your project you need to add a reference to the "Windows Script Host Object Model" to your project. It's under the COM tab in the "Add A Reference" dialog.
|
|
|
|
|
Dear All, c# and SQL Guys.
we are working in Distributed envoirnment, we have got 34 remote office and 1 HQ,
each remote office runs access application with c# as frondend and HQ runs SQL 2005.
well, i have created a service in remotes office which gets any newly record from .mdb file and then creates an xml file of that, then sends this xml to remote FTP.
from HQ another service runs which gets those xml files from FTP and then manipulates those statements against our HQ database.
we have made replication between our HQ and WEb SERVER which both runs SQL 2005. Replication works perfect.
creating xml from remote office are perfect, downloading and executing them against HQ Database is again perfect.
i have a question
1. I want to get newly records from HQ and WEB SERVER and then these records should be in remote office "what method u guys recommend?"
we have also web application which is connected to WEB SERVER
I would really ur ideas and also their benefits with drawback
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
DateTime stamp for record update or a GUID. If you use a date time stamp all of your offices will need to use GMT internally for date checks, if you use the GUID, inadvertent overwrites can occur if you go in the wrong direction.
|
|
|
|
|
well, i think u r not more clear. can u please clearfy your idea.
well, i am asking about how to get updates from HQ and WEB SERVER to remote office.
adding GUID or timestamp column to tables, well, then what method use to get these updates from remote offices.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Can't be bothered. Besides the rules of the forums don't allow me to say what I want to.
|
|
|
|
|
I am really sorry, my question was only to understand ur idea.
so kindly i asked u to make your idea alittle bit clear.
once again if some thing was wrong i am really sorry!!!
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
There is no real answer I can give other than suggesting you use a DateTime stamp or a GUID without actually writing code for you. There are literally hundreds of ways to sync up remote machines with a central server. The best method is a direct result of looking at your current implementation and seeing what works the most accurately under the constraints that your system has in place. What methods have you tried that have failed? Or have you not written any sample code yet?
|
|
|
|
|
well, i haved sued this method.
i have created triggers in some tables in WEB SERVER which i need the data from.
when certain data changes so those triggers are fired and certain fields are changed and at all these tables has one field which shows certains records are udpated.
from remote office iam looking for those field which show they are updated, then i am executing CLR Query which create xml of those updates and then i am downloading thoese updates to remote office.
but the only thing which i want is how i should the WEB SERVER that these are downloaded by another PMU.
in case if the xml file creation is succesfull, and no flag has occured to WEB SERVER then what i should do to not download a file twice,
i dont want to delete files from ftp, bz they are sometimes used as backup.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hello All ,
i know that DLLImport is used to call some unmanaged Code . Like some third party dll is there and we want to make use of that .
But my question is like i have created one class library using .net only . So when i build that i had DLL too of that . this is managed code .
Now i have placed this dll in GAC.
i want to make use of this DLL in my application by using DLL Import. when i tried it is throwing an exception like DLL not found .
So my question cant we call managed dll using DLLImport ? i know i can add that dll as a refernce and can use it but i dont want that . So it possible with DLLImport or it is only for unmangedDLL.
2. if suppose i am calling an unmanged DLL i.e third pary compnent ... how CLR will locate its address using DLL Import
Sorry for trouble .. But my mind is messed with this.
|
|
|
|
|
No.
DllImport is for unmnaged code.
for managed code you should:
- add a reference to your project
- want a "using" statetement
- use the managed classes as if they are inside your EXE
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Okie i got it
but how abt this question ?
if suppose i am calling an unmanged DLL i.e third pary compnent ... how CLR will locate its address using DLL Import
|
|
|
|
|
By looking it up in the DLL exports list?
|
|
|
|
|
jpk420 wrote: how CLR will locate its address using DLL Import
Just like any EXE locates functions in some DLL: searching the exported symbols table by name (there is a scheme using "ordinal numbers" too, AFAIK CLR doesn't use that).
The DllImport directive specifies the DLL name, the Windows system environment variable "PATH" tells which folders to search, the optional "EntryPoint" parameter inside DllImport allows you to rename the function.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Sorry i think that part of the code was a shorcut to some imoticon
Aman
|
|
|
|
|
Hi,
you need some variables when reading from the console. Here is a way to get a number (note the use of PRE tags for readability):
Console.WriteLine("please enter number:");
string s=Console.ReadLine();
int number;
bool OK=int.TryParse(s, out number);
if (OK) {
Console.WriteLine("You entered the number "+number);
} else {
Console.WriteLine("Unacceptable input: "+s);
}
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Dear Luc Pattyn,
Thank you very much for your help, however the brackets are still red and the error message is still there.
Thank you very much for oyur help and sorry for the inconvenience,
Aman
|
|
|
|
|
Hi,
what brackets? do you mean the parentheses?
did you put your code inside a method, the method inside a class, the class inside a namespace?
if there is an error message, give it as is.
if it specifies a line number, check that line.
work on the first error message first.
and teach your IDE to always show line numbers, see #102 here[^]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Dear Luc Pattyn,
I have fixed this problem, the problem was that one of the settings for c# was changed. I dont know how that happened. I just reset all the settings to default and that worked.
Thank you very much for helping,
Aman
|
|
|
|
|
Hi Aman,
you're welcome.
BTW: Please don't delete any messages, they should remain visible to keep the thread intelligible and available for future reference.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi Luc,
Right sorry i just thought that if i kept it open people would have thought that this is still a issue/problem.
I did not know that you where ment to keep it open , thank you for telling me i now know
Thank you,
Aman
|
|
|
|
|
What you can do is:
- add "(SOLVED)" to the subject line of the original post
- click "good answer" on the reply that did it for you (that removes it from the "unanswered questions" list)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
THIS PROBLEM IS FIXED.
I would like to thank everybody that offered solutions and tried to help,
Aman
|
|
|
|
|
Thank you all for helping me solve this simple problem, i did not realise that my settings had been changed,
Aman
|
|
|
|
|
hello everyone out there!
I have one problem and I hope someone can help me. There is one project what I am working on and is mostly data scraping and saving data in xml document. I have an option to create lists and then add data to the lists. For example, the user can create list for restaurants, and I am creating xml document just with one xml element: <restaurants>.
Then once I have all the data scraped I want to add xml nodes with the data what I have to the existing document. I am trying something like this:
string path = Properties.Settings.Default.XMLFolder + list + ".xml";
XmlTextReader rdr = new XmlTextReader(path);
XmlDocument doc = new XmlDocument();
doc.Load(rdr);
XmlNode nodeBusiness = doc.CreateNode(XmlNodeType.Element, "Business", string.Empty);
nodeBusiness.Attributes.Append(attribute);
docData.AppendChild(nodeBusiness);
I am getting an error at the last step: "This document already has a 'DocumentElement' node."
Can someone help me to solve this issue, thanks in advance. Laziale
|
|
|
|