|
Luc,
Thanks for your response. But my coding is almost dynamic, I am creating my database tables with the datatypes that I have in the schema and then I am loading all the values from the xml file to the database.
I am including a small part of my code where I am just printing the values by looping through the dataset and where the hex values are getting omitted.
foreach(DataTable table in dataset.Tables)
{
Console.WriteLine("TableName = " + table.TableName);
Console.WriteLine ("{0}", "---------");
Console.WriteLine("Columns ...");
foreach(DataColumn column in table.Columns)
{
Console.Write("{0,-22}",column.ColumnName);
}
Console.WriteLine("\r\nNumber of rows = {0}", table.Rows.Count.ToString());
Console.WriteLine("Rows ...");
foreach(DataRow row in table.Rows)
{
foreach(Object value in row.ItemArray)
{
Console.Write("{0,-22}",value.ToString());
}
Console.WriteLine();
}
Console.WriteLine();
}
|
|
|
|
|
I don't see anything refering to ints or hex. Don't know what to think of it.
If you want real help, I suggest you show the code that writes the file, then
a part of the XML file showing how the hex numbers look like, then the code that
reads/shows the file.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have included a sample schema file, xml file and my sample code.
Any help is appreciated.
XML Schema is as follows: sample.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="System">
<xs:complexType>
<xs:sequence>
<xs:element ref="SystemInfo"/>
<xs:element ref="Memory_Block"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SystemInfo">
<xs:complexType>
<xs:attribute name="SystemName" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="TotalThreadAvailable" use="required" type="xs:integer"/>
<xs:attribute name="TotalSystemMemorySize" use="required" type="xs:hexBinary"/>
<xs:attribute name="ThreadAvailableMap" use="required" type="xs:hexBinary"/>
</xs:complexType>
</xs:element>
<xs:element name="Memory_Block">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Range"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Range">
<xs:complexType>
<xs:attribute name="EndAddress" use="required" type="xs:hexBinary"/>
<xs:attribute name="StartAddress" use="required" type="xs:hexBinary"/>
</xs:complexType>
</xs:element>
</xs:schema>
XML File is as follows: sample.xml
<?xml version="1.0" encoding="UTF-8"?>
<System>
<SystemInfo SystemName="xyz" TotalThreadAvailable="8" TotalSystemMemorySize="0x0" ThreadAvailableMap="0x3030303"/>
<Memory_Block>
<Range EndAddress="0x0aaa" StartAddress="0x0"/>
<Range EndAddress="0x0bbb" StartAddress="0x0"/>
<Range EndAddress="0x0ddd" StartAddress="0x0"/>
<Range EndAddress="0x0ccc" StartAddress="0x0"/>
</Memory_Block>
</System>
My sample code:
myXmlDataDocument = new XmlDataDocument();
myStreamReader = new StreamReader("sample.xsd");
myXmlDataDocument.DataSet.ReadXmlSchemamyStreamReader);
myXmlDataDocument.Load("sample.xml");
DisplayTables(myXmlDataDocument.DataSet);
private void DisplayTables(DataSet dataset)
{
// Navigate Dataset
Console.WriteLine("\r\nContent of Tables ...");
foreach(DataTable table in dataset.Tables)
{
Console.WriteLine("TableName = " + table.TableName);
Console.WriteLine ("{0}", "---------");
Console.WriteLine("Columns ...");
foreach(DataColumn column in table.Columns)
{
Console.Write("{0,-22}",column.ColumnName);
}
Console.WriteLine("\r\nNumber of rows = {0}", table.Rows.Count.ToString());
Console.WriteLine("Rows ...");
foreach(DataRow row in table.Rows)
{
foreach(Object value in row.ItemArray)
{
Console.Write("{0,-22}",value.ToString());
}
Console.WriteLine();
}
Console.WriteLine();
}
}
-- modified at 11:10 Tuesday 16th October, 2007
|
|
|
|
|
When showing HTML or XML, it is necessary to check the "ignore HTML tags" checkbox,
otherwise everything gets eaten by the HTML interpreter...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Yes, I did that by modifying the mail.Should I resubmit it?
|
|
|
|
|
Hi,
this document[^] seems to tell us hex values should not include a prefix ("0x").
So I suggest you:
1. try it with an edited file (all 0x removed)
2. if that works, find a way to get that file generated correctly.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
what is the latest version of .net to use
abhi
|
|
|
|
|
The latest released version is .NET 3.0, but the .NET 3.5 release should be out by the end of the year and is currently in public Beta.
|
|
|
|
|
Strictly Scott is correct, but unfortunately the ".NET" name is overloaded. ".NET 3.0" does not include any updates to the Common Language Runtime (the core execution engine), the Base Class Library, Windows Forms, ADO.NET or ASP.NET, which remain unchanged from their .NET 2.0 versions. The only parts that are new are Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), InfoCard and Windows Workflow Foundation (abbreviated WF).
.NET Framework 3.5 will also be 'pure extensions' to .NET 2.0 but will require .NET Framework 2.0 SP1 to be installed, which will ship at the same time. I'm not completely sure how this will work out, whether System.dll will be replaced or not.
So the answer is, if you're targetting Windows Forms or ASP.NET, you need .NET Framework 2.0, but if you're using WPF, WCF, InfoCard or Workflow, you need 3.0 as well.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
i want to create web server that have video(realtime)
and i dont know that how to do.
i saw msn can display video(realtime) from client to client.
you can help me
|
|
|
|
|
You have to set up a streaming video server on your web server. It's a specialized server designed to, well, stream video efficiently.
Look up video servers on Google. It's been awhile, but there were a few good open source ones, and many more proprietary (but superior) ones.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
I am trying to put common configuration settings for 4 applications in a common configuration file.
I have used the
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<linkedConfiguration href="file://E:\Projects\ABC\SOURCE\ABC_SOLUTION\common.config"/>
</assemblyBinding>
in all 4 app.config files so that the settings made there are available.
From each of the application I have used
System.Configuration.ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString
to read the connection string from the common config file.
I get null. Please help.
Thanks in advance.
|
|
|
|
|
When i m Building My ASP .NET application on VS 2005 it works fine i mean it generates the DLL after compilation but ..while compiling the asp .NEt solution file using nant builder it wont generates the required DLL ...
Can anyone will tell me how to run ASP .NET application using NANT script.
Ihave nant-0.85 and web deployement project installed on my PC......
But I dont know how to compile asp net sln file in nant using ASPNET_compiler.exe
I m using the following command in nant builder that doesnt work:
exec program="${dotnet}/aspnet_compiler.exe"
commandline=" -v /abcd.sln -p E:\slnabcd c:\tk1"
aaa
|
|
|
|
|
Please don't cross post. You asked this same question in the Web Development[^] forum.
|
|
|
|
|
Now i have a problem to search pdl(group) in the ldap server, i can search the pdl(group) with the following filter
string filter = "(&(objectClass=group)(displayname=" + displayname + "))"
but can only filter out with the whole display name
if i want to search with partial name, what should i do??
|
|
|
|
|
My LDAP is a little rusty, but IIRC it's:
(&(objectClass=group)(displayName=SomeNa*))
|
|
|
|
|
|
-- modified at 8:59 Thursday 11th October, 2007
i want to create web server that have video(realtime)
and i dont know that how to do.
i saw msn can display video(realtime) from client to client.
you can help me
|
|
|
|
|
You're going to have to be much more specific about what you want to do. Are you thinking of writing the video server or some client to show the video or both?
|
|
|
|
|
Using something along the lines of the following:
XslCompiledTransform transform = new XslCompiledTransform();
transform.Load(Constants.XSLTFile);
using (XmlReader reader = XmlReader.Create(new System.IO.StringReader(sb.ToString())))
{
using (TextWriter textWriter = new StreamWriter(Constants.OutputFile, false, Encoding.GetEncoding("Windows-1252")))
{
transform.Transform(reader, null, textWriter);
}
}
The goal here is to create a text file from XML using XSLT. For auditing purposes need to know how many rows being written to the text file after the tranformation.
All help is appreciated.
Regards,
Boris
|
|
|
|
|
You could create a class that derives from StreamWriter[^], then override the appropriate Write methods. In your overrides, you would check for the TextWriter.NewLine chars.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I have a quad core machine, how many threads can an application domain handle?
How can I determine the capabilities of the machine at runtime to know how many buckets, and threads I can/should use?
|
|
|
|
|
steve_a_p wrote: how many threads can an application domain handle?
I don't know but I would guess it is more than you would want to use. Does that help?
steve_a_p wrote: How can I determine the capabilities of the machine at runtime to know how many buckets, and threads I can/should use?
So you believe the point of interest to your situation is knowing the maximum number of threads that your environment will allow you to allocate?
|
|
|
|
|
Hi,
Environment.ProcessorCount could be useful.
Having lots of threads that (try to) do similar things is not helping since all these
threads will compete for the same resources (either CPU cycles, cache hits, memory bandwidth,
whatever). So I would not exceed twice the processor count for identical threads.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: So I would not exceed twice the processor count for identical threads.
So ProcessorCount * 2 formula... that's good. Now do you have a citation for that?
|
|
|
|