|
Hi,
I guess the problem comes with the namespace (or better the missing namespace). First I would try to serialize without providing a namespace (just put away the XMlSerializerNamespace). If this doesn't work, provide a namespace (e.g. http://tempuri.org)
Please let me know if this helps you.
Regards
Sebastian
|
|
|
|
|
Hi,
Thank you for the suggestions!
When I removed the namespace from the serialization the resulting ArrayOfInputFile looks like:
<ArrayOfInputFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
On Deserialization, another InvalidOperationException: {"There is an error in XML document (2, 2)."} (2,2 cooresponds to the A in ArrayOfInputFile): {"<ArrayOfInputFile xmlns=''> was not expected."}
Providing a namespace, the XML becomes:
<ArrayOfInputFile xmlns:asdf="http://www.helloworld.com/">
With identical exceptions and error messages.
Any other information I can provide?
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Hi,
the second example you provided looks a bit strange. What happens if you change the xml before deserialization so that it looks like this:
<ArrayOfInputFile xmlns="http://www.helloworld.com/">
or
<asdf:ArrayOfInputFile xmlns:asdf="http://www.helloworld.com/">
|
|
|
|
|
Hello again,
If I change it to your first form I get another InvalidOperationException, but the message this time is: {"<ArrayOfInputFile xmlns='http://www.helloworld.com/'> was not expected."}
If I change to the second form I also get: {"<ArrayOfInputFile xmlns='http://www.helloworld.com/'> was not expected."}. Interestingly it doesn't include the "asdf:" at the beginning.
Should I encapsulate this list in a class and manually serialize/deserialize?
Thanks for the help so far!
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Wow, I feel stupid, the error is so simple.
On my deserialization you can see the type is Inputs.InputFile, not List<inputs.inputfile>. Changing it makes everything work!
Thanks for your help and looking at this problem.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
I have been using the following code from msdn to create a slide. But how to create a chart in a slide?
const string sTemplate = "C:\\Program Files\\Microsoft Office\\Templates\\Presentation Designs\\Blends.pot";
const string sPic = "C:\\WINNT\\Soap Bubbles.bmp";
PowerPoint.Application oApp = default(PowerPoint.Application);
PowerPoint.Presentation oPres = default(PowerPoint.Presentation);
PowerPoint.Slide oSlide = default(PowerPoint.Slide);
bool bAssistantOn = false;
//Start Powerpoint and make its window visible but minimized.
oApp = new PowerPoint.Application();
oApp.Visible = Office.MsoTriState.msoCTrue;// Microsoft.Office.Core.MsoTriState.msoCTrue;
oApp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized;
//Create a new presentation based on the specified template.
oPres = oApp.Presentations.Open(sTemplate, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue);
//Build Slide #1:
//Add text to the slide, change the font and insert/position a
//picture on the first slide.
oSlide = oPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
{
oSlide.Shapes[1].TextFrame.TextRange.Text = "My Sample Presentation";
oSlide.Shapes[1].TextFrame.TextRange.Font.Name = "Comic Sans MS";
oSlide.Shapes[1].TextFrame.TextRange.Font.Size = 48;
}
oSlide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 200, 200, 200, 200);// AddPicture(sPic, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 150, 150, 500, 350);
//oSlide.Shapes[1].Table.Rows[1].Cells[1].Borders[ PowerPoint.PpBorderType.ppBorderLeft].
oSlide = null;
PowerPoint.SlideShowSettings oSettings = default(PowerPoint.SlideShowSettings);
oSettings = oPres.SlideShowSettings;
oSettings.StartingSlide = 1;
oSettings.EndingSlide = 1;
//Prevent Office Assistant from displaying alert messages.
bAssistantOn = oApp.Assistant.On;
oApp.Assistant.On = false;
//Run the slide show and wait for the slide show to end.
oSettings.Run();
while (oApp.SlideShowWindows.Count >= 1) {
System.Windows.Forms.Application.DoEvents();
}
oSettings = null;
//Reenable Office Assisant, if it was on.
if (bAssistantOn) {
oApp.Assistant.On = true;
oApp.Assistant.Visible = false;
}
//Close the presentation without saving changes and quit PowerPoint.
oPres.Saved = Microsoft.Office.Core.MsoTriState.msoCTrue;
oPres.Close();
oPres = null;
oApp.Quit();
oApp = null;
GC.Collect();
|
|
|
|
|
Can someone help me with my project on developing a IT Helpdesk?
my project includes:
- web based helpdesk for the end users.
-we have more then 1000 end users in our company.
-the helpdesk should enable users to lodge in any query or complain about having problem with their harware, eg, if the printer is not working.
-if users can not login to the system
-forgot their password or wants their password to be resetted and so on.
-they should be able to add their name, Id number, department,email address,date and time. Also there should be a column for official use only in which the IT administrator will fill in their name, the solution of the problem and the date and time it was fixed
-their should be a submit button which sends the copy of the form to the IT administrator. Then the IT administrator will have to fill in the official column and the form will be saved i the system for future refernce.
i am trying to use C# for the first time for this project.
Can someone tell me how to start with this project since this is my first project after i have joined this It department this month. i have to make it from scratch.
|
|
|
|
|
monishalata wrote: i am trying to use C# for the first time for this project.
So, let's get this right ? you're writing system which your company, which has over 1000 employees, will use to run their helpdesk ? You've never written C# code before ? Have you coded before at all ? Do you work for Telstra, or perhaps Dell ?
You should look for another job. Your boss is obviously a retard, to think that you can somehow create a workable system with no experience.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
if you can't help out then dont act too smart..if i don't have work how will i get experience??? its written that its my first project and am a fresh graduate from uni..we did not use C# for programming..
|
|
|
|
|
Christian's comment wasn't the most polite. However, he has a point - developing an IT Helpdesk system, to support 1000+ end users etc, is a big job, and not something that a new to the language programmer could implement without MUCH strife.
This isn't a dig at you, as it sounds like the requirements are fairly simple and i'm sure that given enough time you could achieve your bosses aims. However, the thing is, your boss is a bit of a dumb-ass. There are so many off the shelf systems that could do what you guys want, that its ridiculous to reinvent the wheel and write yet another system (with all the security gotchyas, bugs, etc that that implies) considering you could just get a premade one and customize it, and make any bugs the vendors problem, not yours.
I highly highly doubt you will be able to churn out something cheaper than the established vendors, especially since their costs are spread across all their customers.
|
|
|
|
|
Hay, dude, pretty much you enter the wrong field, I really can't image a person, like you, with little c# experience can build a workable system from scratch. Your HR or your manager is a .....
Guess what, don't expect people in here are willing to help you, at least not me.
|
|
|
|
|
If you can't help..then don't reply...keep ur comments to urself
|
|
|
|
|
First of all, you need to learn c# and do some "hello world" ex. Secondly you have to learn SQL to save data fields to Database.
Here is a link to a free C# PDF ebooks
Create few apps where you save data to SQL Server or Access before you start with your first project.
|
|
|
|
|
Blikkies - does the link work - I got an error but it could be my net nazi.
The link reads as an excellent resource for the financially challenged newbies.
|
|
|
|
|
Link works fine, only error i get, is an javascript error. I was surprised of how excellent books they give out for free.
|
|
|
|
|
Yup, my very own net nazi stops this at work. Thanks
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thanks..SQL part is already done..only part is C#..but the ebooks are really helpful
|
|
|
|
|
Dear All,
I've written a program that contain 2 parts, I have a UI project (Project_1), which is a WinForm, and dll project (Project_2), which handles the db access. Now in my dll project, I had DbConnectionString settings and it automatically added into app.config (dll project) file. There is another app.config file in UI project.
When I deploy my application into a test machine, I tried to change the DbConnectionString in both Project_1.exe.config and Project_2.dll.config, but the applicatiion doesn't connect to the test database, rather it connects to the database when I was used during developing stage, which is setting that I had in Properties.Settings.settings of the dll project.
Now what I really need is that I would like the application connects to any database that i specified in the DbConnectionString either in Project_1.exe.config or Project_2.dll.config. I am using OleDbConnection object.
Here is the code to get the DbConnectionString: OleDbConnection conn = new OleDbConnection(Properties.Settings.Default.DBConnectionString);
Here is the config file for dll project:
<configuration><configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CodistriCore.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<CodistriCore.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Clients\Codistri\CoRE.mdb</value>
</setting>
</CodistriCore.Properties.Settings>
</applicationSettings>
</configuration>
Here is the config file for WinForm project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Codistri.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings />
<applicationSettings>
<Codistri.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=S:\Clients\Codistri\CoRE.mdb</value>
</setting>
</Codistri.Properties.Settings>
</applicationSettings>
</configuration>
Any help will be much appreciated.
Andie
|
|
|
|
|
I think you need to include part of your DLL config file into the config file of your WinForm project. Try adding the line
<section name="CodistriCore.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> within the sectionGroup tags of the WinForm config so it looks like this: (I won't type the entire tag contents here)
<configSections>
<sectionGroup name="applicationSettings"... />
<section name="Codistri.Properties.Settings"... />
<section name="CodistriCore.Properties.Settings"... />
</sectionGroup>
</configSections>
Then you have to copy this part of your DLL config file:
<CodistriCore.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Clients\Codistri\CoRE.mdb</value>
</setting>
</CodistriCore.Properties.Settings>
to your WinForm config file and place it within the applicationSettings tags:
<applicationSettings>
<Codistri.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=S:\Clients\Codistri\CoRE.mdb</value>
</setting>
</Codistri.Properties.Settings>
<CodistriCore.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Clients\Codistri\CoRE.mdb</value>
</setting>
</CodistriCore.Properties.Settings>
</applicationSettings>
I haven't done this in a while myself so I hope I got it right. This should get you started anyway. Good Luck!
|
|
|
|
|
Thanks a lot mate, this is what i exactly did, but from the dll project, I still can't access to the exe project's config file, e.g. simplly the Codistri namespace is there, but the Properties is not accessable, in otherwords, this statement will cause the exception: Codistri.Properties.Settings.Default.DBConnectionString
|
|
|
|
|
It's been solved, I need to create a Configuration class in dll project with ConnectionString property, then initialise the ConnectionString in .exe class, and passed it back to the dll class.
Thanks for your guys hlep anyway
|
|
|
|
|
Good thing it works!
|
|
|
|
|
I am using C#.net to display the website (Example: "www.yahoo.com/login") in the form (using axWebBrowser). When I enter a string in a text box and click a button, I am trying to display the string in the "Yahoo ID" field on the website displayed on the form. Is it possible? If so, how can this be done? I am new to C#.net and will appreciate any of your help.
Thank you.
|
|
|
|
|
Parse the Document Html to get the Id.
simple.
|
|
|
|
|
Use the web browser control comes with .net. Here is a sample code to give you some idea.
webBrowser1.Document.GetElementById("fieldname").SetAttribute("value", "foo");
webBrowser1.Document.GetElementById("button").InvokeMember("click");
|
|
|
|
|