|
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; }
|
|
|
|
|
I am trying to derive bytes from a pass phrase. The latest MSDN doc
indicated that the PasswordDerivedBytes.GetBytes method is obsolete. This
leads me to the CryptDeriveKey method. I can get it to work just fine with the following:
algName = "TripleDES"
algHashName = "SHA1"
keySize=192
rbgIV. Length =8
[this produces byte[] length = 24 {192 bits}]
Now. I want to create a 256 bit byte[] for use with Rijndael.
Unfortunatelty, I do not know the "correct" parameter values. I thought:
algName = "RijndaelManaged"
algHashName = "SHA256"
keySize=256
rbgIV.Length = 16
I can not get it to work. I keep getting the following exception:
System.Security.Cryptography.CryptographicExceptio n was unhandled
Message="Object identifier (OID) is unknown."
Source="mscorlib"
Q1. What are the valid values for the algName ?
Q2. Can any hash be used for any algnName?
Thanks for you help.
|
|
|
|
|
Dear Sir,
I am working on a ASP.NET application, where i am using OLEdbConnection to connect to the Access 2003.
My objective of writing this code is to be able to change the existing password
Here :
T_EMP_PERSONAL is the table name
change_pwd.Text and pwd_txt.Text are the textboxes
Following is the code
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
try
{
string qry;
qry="Update T_EMP_PERSONAL set PASSWORD='"+change_pwd.Text+"' where PASSWORD='"+pwd_txt.Text+"'";
Label1.Text=qry;
con.Open();
OleDbCommand cmd=new OleDbCommand(qry,con);
cmd.ExecuteNonQuery();
Response.Write("Done");
con.Close();
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
OUTPUT
Syntax error in Update statement.
Where as, when i tried the same query in Sql server 2003 it executes succesfully
so could u pl help me out with this
thanks 4 ur kind support
arun
|
|
|
|