|
So what I need is in code form, I have created an an Xml Scheme file and I want to assign it to a dataset that I create in code but don't know the right way to assign one to the other?
Thanks,
JJ
|
|
|
|
|
I'm guessing your problem is very similar to the one I was asking about above that's regarding the automatic WSDL generation for an XML web service.
In your particular case, I think you should look at creating a class derived from your base class (DataTable or maybe one for the entire DataSet?) and then implement IXmlSerializable. One of the method allows you to return an XmlSchema, which you can read from a file (or from an assembly using reflection, which is what I normally do).
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Ah alittle bit more simpler in my case. Basically I created the XML Scheme in the Schema designer then I assigned the Schema to the dataset.
DataSet ds = new DataSet();
ds.ReadXMLScheme("xsdfile.xsd");
Then I create a datarow from dataset and Add record to dataset.
Works very nicely !
JJ
|
|
|
|
|
First, the schema must conform to a DataSet -like structure, consiting of 2 to 3 levels of elements. If you use VS.NET, you can add a new DataSet item to your project (Add->Add New Item->DataSet) and design it easily like that. If you already have an XML Schema, you can use the xsd.exe /d to generate the class. This will generate a strong-typed DataSet where you can refer to the tables, columns, relationships (if you used the right namespaces, which is why it's also easier to use the VS.NET DataSet designer), etc., by name.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
i downloaded the source files and every time i try to compile them i keep getting these wird error messages can you please tell me how to compile them and in all other ways help me, HELP ME!
|
|
|
|
|
BP128 wrote:
i downloaded the source files
What source files?
BP128 wrote:
i keep getting these wird error messages
Can you be more specific? What is weird about the messages?
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
Missing Diagnostics File And Some Other Things To Do With The Code
|
|
|
|
|
You're going to have to be much more specific if you want anyone to help you.
What code did you download? Can you cut and paste the error from the compiler (I assume you're using VS.NET?).
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Sorry I Am New To This, the first 1 is The Diagnostics File Does not Exist the other 1 is cannot generate the makefile
|
|
|
|
|
Can't generate the makefile?
Are you sure this is C#?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
yes i am i got it of a magzine (it is c#) it is called lccwin32
|
|
|
|
|
Just took a look at the LCC Win32 website.
Since the Win32 version of LCC was started in 1999, it runs on Windows 95, and the changelog on his website mentions specific .H files he fixed, it would seem impossible for it to be C#.
I'm guessing it's C++ or straight C (the product in question is a C compiler).
If the files end in .cpp or .cxx, it's almost certainly C++. If the files end in .c, then it's straight C.
If you have some files that end in .cs, then it's probably C#.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
|
Can any1 tell me where to get the c# tool (if it is not free where i can get a free trial if there is 1
:zzz
|
|
|
|
|
This isn't going to solve your problem. You can't compile C/C++ code with the C# compiler! It's not just another language but a language that targets a completely different runtime! Learn the basics of programming first.
The .NET Framework is available from http://msdn.microsoft.com/netframework/[^]. Make sure you actually READ the documentation first - especially the "Getting Started" topics - before jumping into anything.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am working on a small project that I started at home. It originally was on the C: drive and was working properly. After bringing it to work I placed it in a folder on the server with the other projects folders and now it will not let me run.
I get a security exception:
/////
An unhandled exception of type 'System.Security.SecurityException' occurred in JC Test Fixture.exe
Additional information: Security error.
/////
I used the "Trust an Assembly" wizard and got the same error. I even adjusted the .net security to fully trust the intranet and it still complains.
Is there usually an issue when developing .net apps from a folder on an intranet folder?
The msdn info is very detailed and nearly useless.
Rebuilding the app didn't help, can I just delete some output files and rebuild? Which ones?
Tx
Ken Galer
Electrical Engineer
Preferred Utilities Corp.
Danbury, CT 06810
|
|
|
|
|
There is most definitely an issue when running an assembly from the intranet. Code Access Security is a major feature of the CLR and this is often overlooked. The wizard you use is junk - don't use it. Learn about code access security and use the Microsoft .NET Framework Configuration snap-in and do it the right way.
In your case, you're using a method or class that requires a certain permissiont that is not granted to assemblies running in the Intranet zone. The wizard only collections assembly evidence instead of host evidence and so, if you're using automatic versioning (using the asterisk in the AssemblyVersionAttribute , which is a very BAD idea for so many reasons I can't believe they included it as a feature), the assembly evidence won't match what the wizard collected (because the version is different). Also, assembly evidence isn't always presented to the CLR, such as in the case of smart clients (assemblies executed in Internet Explorer). Code access security is an important feature to understand to avoid these cases and, preferably, use to your advantage to customize your application in case certain permissions are granted to your assembly/assemblies.
Fortunately, there was a great article posted on CodeProject about code access security not long ago: Understanding .NET Code Access Security[^].
You can also find more information about code access security and various permissions in the .NET base class library at http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcodeaccesssecurity.asp[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
It's amazing that I just spend $1100 on CD training for .NET and I didn't hear one word about assembly security. I'll be sure to read that article that you mentioned.
It's equally amazing how cyptic of an answer I got from MS on their newsgroup.
I was able to get the Framework Configuration snap-in to work but only after I realized (after about 3 hours) that there were TWO versions to choose from on my machine. It looks like I was tweaking the one for Version 1.0. When I used the 1.1 version things started to make sense again. I made a new Code Group in Runtime Security Policy/Machine/Code Groups and made my mapped netword drive fully trusted.
You guys ever wonder why you do this stuff for a living?
Thanks
Ken Galer
Electrical Engineer
Preferred Utilities Corp.
Danbury, CT 06810
|
|
|
|
|
Just go to show that the best material you can read is the .NET Framework SDK documentation - and it's free! I learned pretty much everything I know from that in the old 1.0 bata days and everything else is based on experience from that initial reading and checking out interesting code samples on sites like CodeProject.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
**NOOB**
I am over riding the closing event for the main form, Windows Shutdown process halts until the application is manually closed. Then I have to initiate the shutdown sequence again.
Below I have the OnClosing event. I am looking to combine the two below so that they close out the application if Shutdown, Restart or Logoff are initiated.
protected override void OnClosing(CancelEventArgs e)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
Hide();
}
protected override void WndProc(ref Message m)
{
base.WndProc (ref m);
if (m.Msg == 0x0011)
{
Application.Exit();
//this.Close();
}
}
If I have these 2 methods in place, the application WILL shutoff, BUT it will also halt the shutdown process, and once again I have to start the shutdown process all over again.
Thank you in advance for your help.
**DAN**
|
|
|
|
|
Calling Application.Exit sends the WM_QUIT message to the application, this the pump catches and the WM_CLOSE event is not (typically) called, so OnClosing is not executed. That much you've discovered. When handling the WM_QUERYENDSESSION notification message, though, you should set Message.Result = new IntPtr(1); in order to essentially return TRUE as the return value so that the shutdown process isn't canceled. By not setting this value, FALSE is essentially returned and the shutdown process is cancelled as you have noticed.
For more information, see the documentation for the WM_QUERYENDSESSION notification message at http://msdn.microsoft.com/library/en-us/sysinfo/base/wm_queryendsession.asp[^] and pay close attention the return value documentation and the remarks section. Hopefully this will help, but it won't combine those two handlers. Honestly though, it really doesn't matter - it solves the problem and that's what counts. Besides, the Closing event is triggered by the WM_CLOSE message which isn't sent to Windows unless the application pump handles an appropriate message and sends or posts the message itself (at least, from what I remember).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I seem to be encountering difficulty while trying to delete an item from a listbox. The user selects an item from the listbox, then clicks a delete button. The button code is as follows:
<br />
try<br />
{<br />
listBox1.Items.Remove(listBox1.SelectedItem);<br />
}<br />
catch(IndexOutOfRangeException ex)<br />
{<br />
MessageBox.Show("Could not delete the selected item", "Error", MessageBoxButtons.OK);<br />
}<br />
<br />
Now, if I select the first item in the list, and press delete, the exception IndexOutOfRange occurs, however the item is then successfully deleted. If I select any other item in the list and try to delete it, it works fine, no exception
Why does deleting the first item cause an exception
|
|
|
|
|
I test your code and there is no problem with that. It works properly for all items. Whats your error message?
Mazy
No sig. available now.
|
|
|
|
|
i just get an "IndexOutOfRangeException" occuring. Im using Borland C# if thats any help?
|
|
|
|
|
Gavin Coates wrote:
i just get an "IndexOutOfRangeException" occuring
Every exeptions have a Message property, which is string contained a error string.
Gavin Coates wrote:
Borland C#
Oh, I don't know about that. I haven't seen anybody use it here.
Mazy
No sig. available now.
|
|
|
|