|
Please open this link and read the information. They use the name DICTIONARY instead of TABLE. Thanks!
http://www.cs.cf.ac.uk/Dave/Multimedia/node214.html
bettie
|
|
|
|
|
The dictionary, or table, you're reffering to is written into the .ZIP file. The application that decompresses the file then reads the dictionary table from the file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does it mean the table put together with the compressed file when we transfer the file over the network? Thanks!
bettie
|
|
|
|
|
Yes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My sql query looks like
select t1.code,
t2.name
from tab1 t1, tab2 t2 where t1.code=t2.code
Then I call DataAdapter.Fill(DatasetXSD);
no errors occured but DatasetXSD is empty, and when I run the same query in PL/SQL Developer everething works fine...
Maybe some one can tell me anoter way to fill Dataset from multiple tables correctly?
xedom developers team
|
|
|
|
|
I already answered your question below. You must set up table mappings. See the DataAdapter.TableMappings property documentation in the .NET Framework SDK. When you use the DataAdapter designer in VS.NET, it does this for you.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanx, but I tried to use mapping and got the same effect...I even create dataset fom a blank xsd file, and I create a table with 9 columns (like my query returns) and even names and types in dataset.xsd and query result are the same, but I still got an empty Dataset. Could you give me some link for mapping usage? Maybe I do somthing wrong with it..
xedom developers team
|
|
|
|
|
I didn't say create a typed DataSet (which is still a good idea), I said look at the documentation for the DataAdapter.TableMappings property. Even with a typed DataSet , the DataAdapter has to know how to map tables into your DataSet (typed or read in from a schema - whatever the case may be).
Open the .NET Framework SDK documentation (via the SDK start menu group or VS.NET) and type DataAdapter.TableMappings . The .NET Framework SDK includes great documentation, but you have to read it.
In this case (and in many other cases), there's even an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ok thank you very much...I've red all samples(can't say them are very usefull) but it still does not work...
Let me tell you for what I need to work with dataset in that way:
I now developing ASP.NET Application with crystal reports, to use push model I need to add DataSet maunally like xsd file. and then in my application I filling this xsd dataset.
xedom developers team
|
|
|
|
|
Lets say the DataSet has a structure like so:
<DataSet1>
<t1>
<!-- Fields -->
</t1>
<t1>
<!-- Fields -->
</t1>
<t2>
<!-- Fields -->
</t2>
<t2>
<!-- Fields -->
</t2>
</DataSet1> Then before you execute DataAdapter.Fill , executing code similar to the following:
dataAdapter1.TableMappings.Add("Table", "t1");
dataAdapter1.TableMappings.Add("Table1", "t2");
dataAdapter1.Fill(myDataSet1); Now, since you're using table aliases, those will be the table names used in the output so if your DataTable names use the aliases, you shouldn't need this. A DataTableMapping maps the source table name to a destination table name. Trust me - it's the reason your DataSet is empty. You must make sure that your table names in the result sets match up with the table names in the DataSet , whether that DataSet is typed, programmatically created, or read-in from an XSD.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ok, thnak for your information. But I think the problem is that when I run this code:
OracleDataAdapter da = new OracleDataAdapter();
da = new OracleDataAdapter(sql, con);
DataSet ds = new DataSet();
da.Fill(ds);
Everything goes fine. But when I've just to use my xsd datset like this:
OracleDataAdapter da = new OracleDataAdapter();
da = new OracleDataAdapter(sql, con);
dsXSD = new DataSet();
da.Fill(dsXSD);
It returns an empty dataset, only columns header are avialinle to be shown in the datagrid.
xedom developers team
|
|
|
|
|
Look at the "generic" DataSet generated with the first statement. See how the tables are named. Now name the tables in your typed DataSet the same way, or use a DataTableMapping as I've said several times above. If the table names in the result set don't match up with the names of a configured DataSet , it will remain empty.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thnank you! It works now!!! I've just renamed dataset tebles...but I still don't understand how DataTableMapping works, but anyway thanx for you advises. Crystal Reports not so suitable technology as for me...
xedom developers team
|
|
|
|
|
leTaon wrote:
Crystal Reports not so suitable technology
I agree. While the user's experience is great with Crystal, the developer goes through literal hell trying to get it working correctly.
Yes, I program in VB6, but only because I use it to fill my addiction to having a dry place to sleep and food to eat!
|
|
|
|
|
Just look at the class name: table mappings. If you look at the documentation, it maps a source table name to a destination table name, so that if the table name in the result set the DataAdapter gets is different from what you want it to be in a configured DataSet , it will map it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi!
I am trying to use XmlSerialization in the following scenario:
1. I have a class called Test:
public class Test
{
private int someAttribute;
[XmlAttribute]
public int Att
{
get
{
return someAttribute;
}
set
{
someAttribute=value;
}
}
}
2. And a subclass:
public class SubTest
{
public string something;
}
Upon serilialization, I get the following:
<Test Att="int" />
<SubTest>
<something>string</something>
</SubTest>
As can be seen the attribute Att is not visible in the subclass. Using virtual (for the property) and overriding it, or just hiding it with 'new' also did not help. Creating a new attribute with the same name (i.e. marking it as [XmlAttribute("Att")] also creates an error. Any suggestion as to how I can have an attribute of the same name in the subclass also?
Thanks!
|
|
|
|
|
I see no subclasses. SubTest does not extend Test , i.e. you must code it as SubText : Test .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thats what happens when you don't copy and paste
In my actual code Subtest extends test
so:
public class SubTest:Test
{
public string something;
}
Thanks!
|
|
|
|
|
When you create your XmlSerializer instance, make sure you create it using either your instance of SubTest or the type of SubTest (using typeof(SubTest) ). The following sample works just fine:
using System;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
public class Test
{
static void Main()
{
SubTest test = new SubTest();
XmlTextWriter writer = new XmlTextWriter("Test.xml", Encoding.UTF8);
XmlSerializer serializer = new XmlSerializer(typeof(SubTest));
serializer.Serialize(writer, test);
}
[XmlAttribute]
public int Attr
{
get { return 1; }
set { ; }
}
}
public class SubTest : Test
{
public string Something = "Test";
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks!
I was actually trying to do this as part of creating a webservice, and apologies for not making this more specific.
I have a webmethod which looks something like:
MyWebMethod(SubTest sub){
somestuff;
}
When I create the webservice and look at the soap message that would be sent, I don't see the attribute there (i.e. the string looks like <sub> string </sub> instead of <sub att=int> string </sub>. I guess the default xmlserializer does not pick the derived attribute. Is there anyway of informing the serializer in the context of writing a webservice?
Thanks!
|
|
|
|
|
I'm new to C#, just started building my first few applications. I wanted to build a really simple program for manipulating my cd/dvd drive. I want to have a Play, a stop, and an eject button.
I was thinking of followign this tutorial CD Player library using MCI
Unfortunately, I've run into my first problem. I can't seem to find DeviceController.dll. I'm using the free C# IDE by Borland, and on my listing of references, this doesn't appear. A friend suggest that I make sure I have the Platform SDK installed, but after installing that and rebotting, the .dll still was not available.
Is there a newer .dll or another way of doing this in high level? Or am I stuck until I find this .dll?
|
|
|
|
|
DeviceController.dll is already compiled in the Demo Application ZIP file, and you can compile it from the source. Both links are at the top of the article (typical for articles on CodeProject). Extract that DLL to some directory on your hard drive and add a reference to that DLL (assembly) to your project. Just click the Browse button and browse to the directory where you extracted it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You didn't download the source files for that article, did you? You'll find the DeviceController.dll that you're looking for in the source files .Zip file. It's not a standard .DLL you'll find on any Windows machine. It was custom written by the author of the article.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Oh. I didn't download it because I thought it was a standard DLL. I didn't realize it was custom written. I downloaded it and browsed through it, but wanted to do this on my own from scratch. I guess I'll have to develop my own dll too. Thanks.
|
|
|
|
|
The source for the .DLL is in there too if you want to take a look to see how it's done...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|