|
I am working with the office outlook, it is working fine with console version, but when i use it with window service, it does not work.
I am getting the following log entry
Event Type: Error
Event Source: Microsoft Office 11
Event Category: None
Event ID: 2001
Date: 8/16/2006
Time: 6:38:46 PM
User: N/A
Computer: XYZ
Description:
The description for Event ID ( 2001 ) in Source ( Microsoft Office 11 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Microsoft Office Outlook, .
Any idea???
|
|
|
|
|
Windows service runs in a separate user context, i think this is the root cause of the problem.
Try running it under the same user as your console application (your login id).
Also try turning on "allow this service to interact with the desktop" feature.
|
|
|
|
|
Thanx for the reply but these solutions don't seem to work. The actual line of error is
Outlook.MAPIFolder objFolder;<br />
Outlook.NameSpace objNamespace;<br />
objFolder = objNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
here objFolder.Items.Count = 0. While in case of console application im getting the actual no of mails.
|
|
|
|
|
Hello,
I want the Schema of my dataset to be read in a while loop and printed out. Simple isn't it? Well it is not..Let me explain..I am calling the ReadXmlSchema as follows, (my dataset is called dsPersisted)
XmlTextReader reader = new XmlTextReader(new StreamReader(new MemoryStream(),Encoding.UTF8));<br />
<br />
dsPersisted.ReadXmlSchema(reader);
<br />
while (reader.Read())<br />
{<br />
Response.Write(reader.Name);<br />
}<br />
reader.Close();<br />
The Read() method inside the loop just doesn't work. Instead of a MemoryStream, if I use a filestream it works. But I don't want to use a filestream.
The dataset is definitely not empty and it has a schema (100% sure).
any help is appreciated
Siva
Sinceresiva
|
|
|
|
|
Hah!!! I myself have found the solution to the above problem. What I was getting was the following error
root element is missing
I modified the code as below and it works!!!
MemoryStream memStream = new MemoryStream();<br />
dsPersisted.WriteXmlSchema(memStream);<br />
<br />
memStream.Position = 0;<br />
<br />
XmlTextReader reader = new XmlTextReader(memStream);<br />
<br />
while (reader.Read())<br />
{<br />
Response.Write(reader.Name);<br />
}<br />
reader.Close();<br />
thanks,
Siva
|
|
|
|
|
Hi, i'm a newbie trying to connect to an Access 2000 database but keep getting the following error: "Could not find installable ISAM"
The code I am using is:
string conString = @"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\myDB.mdb"<br />
<br />
OleDBConnection con = new OleDbConnection(conString);<br />
<br />
con.Open();
Some help would be greatly appreciated.
Thanks
|
|
|
|
|
Change "DataSource" to "Data Source".
---
b { font-weight: normal; }
|
|
|
|
|
I noticed you posted this also in the SQL message board. Note that cross-posting will get you flamed by some!
|
|
|
|
|
sorry, I didnt realise! thanks for the help, Guffa!. school boy error!! the code now works. it was just a syntax error - "Data Source" rather than "DataSource"
-- modified at 11:46 Thursday 17th August, 2006
|
|
|
|
|
Hi guys,
does anyone have some sample code or a link to some sample code for a HTTP POST which sends a string to a url and recieves a string as a response?????????
Will
|
|
|
|
|
|
Sweet that should be perfect thanks alot.
did you just do a search in msdn for that???
Will
|
|
|
|
|
Google actually
|
|
|
|
|
I'm so glad that that word has become a verb. The world would be full of stupid people if there was no google
|
|
|
|
|
Hi!
I just created a simple server that prints messages received from the client to console(the server
listens to port 5000).
My problem is this(and I'm not sure if I posted this to the right forum):
When I start the server and try connecting to it from another computer the remote computer
declines the connection and I get a System.Net.Sockets.SocketException-exception.
I have disabled all firewalls(Windows firewall) from the remote computer but I still
keep getting the same exception. I have also tried different port-numbers without success.
Any thoughts, solutions and suggestions are very much appreciated.
-K-
--------------------
Brian: You have to be different!
Crowd: Yes! We are all different!
Small lonely voice: I'm not!
|
|
|
|
|
What IP address are you listening on the server side?
If you listen on 127.0.0.1(localhost) you won't be able to connect from remote computer,
but will successfully connect from the same machine.
Vitaliy
|
|
|
|
|
Oh, yeah! That was it!
Thank you very much!
-K-
|
|
|
|
|
Hi, there are two functions below that do the same thing.
And the question is which one of them is more readable? Which one would you prefere? And why?
Thanks in advance,
Vitaliy
version 1:
__________________________________
<code>
private ContentParameterDetail GetParameterFromProfile(ContentParameterX prm, SubscriptionScenario scenario)
{
string profileKey = scenario.TimeoutMode ? prm.GetFromProfileTimeout : prm.GetFromProfile;
if (string.IsNullOrEmpty(profileKey))
{
return null;
}
string parameterValue = scenario.IPHelper.Profile[profileKey];
if (string.IsNullOrEmpty(parameterValue))
{
return null;
}
ContentParameter parameter = _entity.ContentConfig.GetParameter(prm.ParameterID);
ContentParameterDetail pd = parameter.GetDetailbySPGWCode(parameterValue);
return pd;
}
</code>
version 2:
__________________________________
<code>
private ContentParameterDetail GetParameterFromProfile(ContentParameterX prm, SubscriptionScenario scenario)
{
ContentParameterDetail pd = null;
string profileKey = scenario.TimeoutMode ? prm.GetFromProfileTimeout : prm.GetFromProfile;
if(!string.IsNullOrEmpty(profileKey))
{
string parameterValue = scenario.IPHelper.Profile[profileKey];
if (!string.IsNullOrEmpty(parameterValue))
{
ContentParameter parameter = _entity.ContentConfig.GetParameter(prm.ParameterID);
pd = parameter.GetDetailbySPGWCode(parameterValue);
}
}
return pd;
}
</code>
|
|
|
|
|
I prefer version 1 cause there it's perfectly clear that null gets returned if string.IsNullOrEmpty is true. In version 2 I have to take a look at the whole method to see that pd isn't changed anywhere and therefor null will be returned.
"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
|
|
|
|
|
Yes, good point. I just wonder if those multiple return statements are bad. Otherwise I defenitely go with version 1.
Vitaliy
|
|
|
|
|
Vitaliy Tsvayer wrote: if those multiple return statements are bad
This is a controversial topic and you can find many comments on this when googling for "multiple returns" e.g. this one[^] by Bruce Eckel.
"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
|
|
|
|
|
I would go with version 1...
You can actually see when it returns null, in version 2 you really have to read all the code to know when it returns null...
Don't you also love the code?
|
|
|
|
|
Yes, Stefan in above reply also pointed that out.
OK, I go with version 1.
I LOVE THE CODE!
Vitaliy
|
|
|
|
|
Hello,
I have XML file, I can read and write data on it but there is a problem when i add data cause it overwrites the previuos inserted ones.
I need a code of insterting new data over the existing ones without updating i need to insert new values without the change on the previuos ones.
Thanks alot
Hamody
|
|
|
|
|
You can not add values to an XML file. Load the XML file to an XmlDocument object, add the items to the document, and save the document back to the file.
---
b { font-weight: normal; }
|
|
|
|