|
i want to sync my calendar application with microsoft outlook calendar. I want to share this data through XML. i want to implement 2 way sync. Does any one have any idea of approach which i can follow ??? I am facing problem while comparing my application data with outlook data while merging. plz help
|
|
|
|
|
I have been working on this issue for a few days now and I am growing tired and desperate
I have made this application which sends a screenshot (Image type) to another PC. All works well on most PCs except some very few of them. Those that do not work complain of a Binary stream '0' does not contain a valid BinaryHeader.
The code is exactly the same on the working / non-working PCs. I have also attempted to run the program locally on the PCs not working, and the exact problem occurs.
The Algorithm is as follows:
- Screenshot is taken (returned as Image)
- Size of the Image is sent (to prepare a byte[] for the receiving end)
- Image is converted into a MemoryStream from BinaryFormatter.Serialize
- MemoryStream.ToArray() gets byte[] which is written on a NetworkStream
- Receiving end receives the length of the object and prepares a byte[] with that length
- Receiving end reads the data on a byte[]
- Byte[] is Deserialized to object <- Exception occurs
I have checked the first 50 bytes being sent and received and they are exactly identical!!
It is true that the first byte is a 0 but this works with no problems at all on other systems
Why is this happening? How can I avoid this? Maybe using UnsafeDeserialize or something completely different?!
Any help is sooo greatly appreciated!!
|
|
|
|
|
Hi,
I don't know what problem you are having. One possibility is the (de)serializer is having an out-of-memory problem due to fragmentation in the large-object-heap.
Why do you need serialization at all? Couldn't you use Bitmap.Save(NetworkStream) and new Bitmap(NetworkStream)? I don't like your scheme requiring a potentially large array that much.
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.
|
|
|
|
|
i m doin device application
the problem is wih socket
my code was
clientsocket = new TcpClient(ip,2000);
clientsocket.ReceiveTimeout=10000;
this code gives an exception "option is not supported or something like that"
but this workd fine in windows application
so i wrote
clientsocket = new TcpClient(ip,2000);
this line raises exception
i m receiving exception
"An operation was attempted on something that is not a socket" after sometime or after a sequence of clicks
i think the problem is with socket timeout
if so how can i increase the socket time out
can any one help
This code was posted by me...
|
|
|
|
|
Hi,
I suggest you read the remarks in the MSDN document.[^] which is always a good thing to do (1) before using something and (2) when having problems.
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.
|
|
|
|
|
Out email provider has SMTP authentication set to require "Log on to incoming mail server before sending"
In outlook, I configure this option in the Outgoing Server Settings. Its easy.
However, I can find no way of doing this programatically with System.Net.Mail. Or at least no config settings that give a clue.
If I set outlook to use the same credentials as the incoming server then it fails. i.e. I can't just provide the username and password as it won't work.
Any clues?
regards
James
|
|
|
|
|
you can do it like this:
<system.net>
<mailSettings>
<smtp from="validname@mydomain.com">
<network host="mail.mydomain.com" password="" userName="validname@mydomain.com"/>
</smtp>
</mailSettings>
</system.net>
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
public class TXDataGridViewNumericColumn : DataGridViewColumn
{
public TXDataGridViewNumericColumn() : base(new TXNumericCell())
{
this.InputType = NumericType.Integer;
}
public override DataGridViewCell CellTemplate
{
get
{
return base.CellTemplate;
}
set
{
if (value != null &&
!value.GetType().IsAssignableFrom(typeof(TXNumericCell)))
{
throw new InvalidCastException("Must be a CalendarCell");
}
base.CellTemplate = value;
}
}
private NumericType m_NumericType;
public enum NumericType
{
Decimal,
Integer,
PositiveDecimal,
NegativeDecimal,
PositiveInteger,
NegativeInteger
}
public NumericType InputType
{
get { return m_NumericType; }
set { m_NumericType = value; }
}
public ICollection testCollection
{
get
{
return Icollection;
}
set
{
Icollection = value;
}
}
private ICollection Icollection;
public override object Clone()
{
DataGridViewColumn col = (DataGridViewColumn)base.Clone();
col.CellTemplate = new TXNumericCell();
return col;
}
}
I define a column by inheritting the DataGridViewColumn, and add a property for this column, but in the design-mode when I change the value of this property , the value can not be saved, the codes as above. how to solve this issue? Thanks in advance!
|
|
|
|
|
you have already posted this question!!!!!
posting questions again does not mean you will get the answer quickly
and also try to search answers your self and id dont find it then post the question
|
|
|
|
|
Hi,
Can someone give me some straight example on how to view such an Office Document '.doc' in a Web Browser Control .
You're help is really appreciated .
Kind Regards,
Erson
|
|
|
|
|
Don't repost - it displays an ignorance of forum use
What the hell do you want if the link d@nish supplied is not an answer to your question.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The link d@nish sent you was probably the ONLY straight forward approach to doing what you want. I also was looking something like this and I have already implemented the feature with no issues. What's stopping you?
Regards,
Jason Pezzimenti.
|
|
|
|
|
Hi.
I need to calculate the difference between two date and time fields
I Am Try blow coding but give error
"String was not recognized as a valid DateTime"
InitializeComponent();
{
timer.Tick += new EventHandler(timer1_Tick);
timer.Interval = (1000) * (1);
timer.Enabled = true;
timer.Start();
}
private void Form1_Load(object sender, EventArgs e)
{
label7.Text = DateTime.Now.ToShortTimeString();
DateTime dt1 = DateTime.ParseExact(label6.Text, "hh:mm:ss", new DateTimeFormatInfo());
DateTime dt2 = DateTime.ParseExact(label7.Text, "hh:mm:ss", new DateTimeFormatInfo());
TimeSpan ts1 = dt1.Subtract(dt2);
textBox1.Text = ts1.ToString();
}
private void timer1_Tick(object sender, EventArgs e)
{
label6.Text = DateTime.Now.ToShortTimeString();
label6.Text = DateTime.Now.ToString("hh:mm:ss");
}
|
|
|
|
|
On my PC, DateTime.Now.ToShortTimeString() shows the date as 11:42 AM. If you have something similar, it will fail when you parse it as hh:mm:ss.
What happens when you debug it and watch the values? Do the two labels really show the date in hh:mm:ss format? Either change the format string, or use DateTime.Now when you do the subtraction.
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
Values in label6 is like 11:18:17 and Values of label7 is 11:18:17, the value of label7 is constant.
|
|
|
|
|
DateTime dt1 = DateTime.ParseExact("11:15:00", "hh:mm:ss", new DateTimeFormatInfo());
DateTime dt2 = DateTime.ParseExact("11:20:00", "hh:mm:ss", new DateTimeFormatInfo());
TimeSpan ts1 = dt1.Subtract(dt2);
Console.WriteLine(ts1.ToString());
Works for me.
Do you get the error when you create dt1 or dt2?
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
yes i get the error when value insert in dt1 or dt2.
|
|
|
|
|
Hi,
what is all this???
have you read the DataTimeFormatInfo documentation[^]?
are you aware that ToShortTimeString() uses the regional settings of your PC?
and new DateTimeFormatInfo() does not?
and why store text twice in label6?
and why parse text from label7 as you know quite well what is in there?
and why going for a negative time span?
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.
|
|
|
|
|
Sir
i want to calculate difference b/w time
u give me some suggestion.
|
|
|
|
|
Hi,
so you choose to ignore my 7 questions? and want something from me? take this:
private DateTime started;
public Form1() {
InitializeComponent();
started=DateTime.Now;
timer.Tick += new EventHandler(timer1_Tick);
timer.Interval = (1000) * (1);
timer.Start();
}
private void timer1_Tick(object sender, EventArgs e) {
DateTime now=DateTime.Now;
label6.Text = "It is now "+now.ToString("HH:mm:ss");
double seconds=now.Subtract(started).TotalSeconds;
label7.Text = "which is "+seconds+" seconds since this form started.";
}
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.
|
|
|
|
|
Luc, I appreciate your intent, but spoonfeeding creates rather than solves problems.
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
I agree, and I seldom do spoon feed. I usually provide pointers, and/or my go study a book[^] advice.
In this case, there was too much wrong IMO, so I decided to provide a reasonable starting point.
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,
Can someone give me some straight example on how to view such an Office Document '.doc' in a Web Browser Control.
You're help is really appreciated .
Kind Regards,
Erson
|
|
|
|
|
See this[^] article.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thank you for this. I just happened to be in the right place at the right time lol
Regards,
Jason Pezzimenti.
|
|
|
|