|
Please re-format your question to reflect code in < pre > tags.
Clearly say what you are saying, so that we may be able to help you.
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
|
I have a C# mobile application class. In that, there is a functionality which I use XmlTextWriter class. While compiling I am getting the following error:
The type 'System.Xml.XmlTextWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I have added reference of System.Xml through Add Reference and also use the namespace by the keyword 'using...'. Still I am getting the same error. Any Idea how to resolve this? I am using Visual Studio 2005 SP2. Is this belong to some setup issue? Please help.
Thanks
meeram395.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Click on System.Xml in the references section. Click properties, and see what the version number is. Make sure you are using the correct version.
|
|
|
|
|
The version and runtime version is 2.0.0.0 only. Is there any other settings need to change?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
The only thing I've got to wonder is if this is the mobile version or the desktop version, and whether you have multiple projects in your solution (in which case you'd have the ensure the same was present in all projects this particular project was referenced in).
|
|
|
|
|
meeram395 wrote: I have a C# mobile application class.
Looks like it may not be available for mobile;
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
I are Troll
|
|
|
|
|
Ok.
The error doesn't have any relation with mobile development. The error occurs in a simple class which is having XMLTextWriting functionality
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: The error doesn't have any relation with mobile development.
It depends. Are you trying to use the class from the Compact Framework? Seems it is not part of that framework, and I doubt that you can simply reference libraries that where meant to run on a real desktop.
I are Troll
|
|
|
|
|
Ok. That makes sense. Thanks very much.
I tried to view the reference in object properties and I can see two xml references, one is without Compact Framework and one is with it. So I believe that it is referencing from Compact Framework. Let me try to resolve this. Would be great if you can have some inputs.
Thanks once again
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
I'm trying to display a date in a c# ms excel report (via the office object library dll) to display as the following (including the commas):
Wednesday, May 4, 2011
I've tried several attempts but no luck so far. What's the format I should be using to display a c# datetime correctly?
Thanks.
|
|
|
|
|
This is a C# forum so the answer from here would be
DateTime.Now.ToString("dddd, MMMM d, yyyy")
If this is different from what works in excel, you may need to ask in a different forum.
Brent
|
|
|
|
|
You can format DateTime strings in .NET any way you want. This little article[^] of mine contains the necessary links to MSDN, and more.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Or maybe use the long date time option.
|
|
|
|
|
If you mean that you want it formatted by Excel then you have to add the formatting to the cell that holds the datetime value.
The best things in life are not things.
|
|
|
|
|
Thanks for the help. My solution kept unfortunately having issues using the above formats within my excel report however when I placed a comma in front of the date, it worked fine.
String reportDate = "'" + DateTime.Now.ToString("dddd, MMMM d, yyyy");
Thanks.
|
|
|
|
|
In Form2 Properties I set - IsMDIContainer = True. And Form3 is MdiChild with Formborderstyle=None. MdiPaarent Form2 is having Toolstrip Hence while I dock its possible to see from all mdichild forms. And my problem is when I click the close button, it's also closing the MDIParent. But I need to close only mdichild... for that I tried as like Vb.Net2008 style by the following codes placed in MDIParent Form2, Its not working. Any right directions ...
private void toolStripButton1_Click(object sender, EventArgs e)
{
Form3 NwMdiChild2 = new Form3;
NwMdiChild2.MdiParent = this;
NwMdiChild2.Dock = System.Windows.Forms.DockStyle.Fill;
NwMdiChild2.Show();
}
private void Form2_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) {
Form[] MdiChildForms = this.MdiChildren;
int kkk1 = MdiChildForms.Length;
int x = 0;
for (x = 0; x <= MdiChildForms.Length - 1; x += 1)
{
if (MdiChildForms[x].Name == "Form1")
{ kkk1 = kkk1 - 1;
}
MdiChildForms[x].Close();
}
if (kkk1 > 0)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
Application.Exit();
}
}
Any Right Directions for Me?
Thanks For Reply
|
|
|
|
|
So you want this...
The user clicks the close button on the MdiParent and
if there are child forms open, close them all but leave the parent open
else close the parent & application
?
If so, this will do it. I have renamed the forms/controls to sensible names so the code is easier to follow.
using System;
using System.Windows.Forms;
namespace MdiApplicationTest
{
public partial class FormParent : Form
{
public FormParent()
{
InitializeComponent();
}
private void toolStripButtonNewChild_Click(object sender, EventArgs e)
{
FormChild child = new FormChild();
child.MdiParent = this;
child.Dock = DockStyle.Fill;
child.Show();
}
private void FormParent_FormClosing(object sender, FormClosingEventArgs e)
{
if (MdiChildren.Length > 0)
{
foreach (Form form in MdiChildren)
form.Close();
e.Cancel = true;
}
}
}
}
|
|
|
|
|
Hi Dave,
Thousands of thanks to your kindness...Because I remember when I start Vb.Net you are the one teach to me lot of things.
Just I started C# VS 2010.
But here the problem project startup is
Program.cs
And same code I put in my MDIcontainer its not fired. I checked by messagebox also. I don't know how to detect..
Is it because of startup program ?
Can you pls. check it in C# VS2010?
Thanks Again
|
|
|
|
|
I'm not sure how you're hooking your stuff together.
Here[^] is my solution zipped - see if you can work out how I've done it by examining it.
|
|
|
|
|
Thanks...
It helpmed me lot...
Thanks Again
|
|
|
|
|
Hello Everybody,
I have a variable of property. Now i want to know that how to apply this to Control.
Like :
PropertyInfo Control_Baccolor ;
Now i want to apply this in control:
Button1.Backcolor = ???????
Pls help me how can it possible.
If you can think then I Can.
|
|
|
|
|
|
First, You can assign only System.Drawing.Color to Button1.Backcolor.
Second, you need to create new derived button class or Create custom control, to be able to assign your own properties, to your needs. (Custom Control Example[^]
♫ 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,
I am working on application which use Apple iPod. We check weather device is connected using WMI query.
We are using NUnit for unit testing. Every-time we need to check function which searches device we need to plug-in iPod. But just for unit testing, having iPod not seems to be feasible.
Can we add virtual device, so we can detect it using WMI, without having device physically present.
Thanks in Advance.
Happy Programming.
|
|
|
|
|
Only if you get out the device driver kit and write a device yourself.
It would be FAR easier and quicker to plug in any old iPod.
|
|
|
|