|
If you will build a DOM tree you will get different tree's.
You will have to use some other aproach...
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Ok. The trees coulde be diffrent. But when I'll comparing these trees I coudle ignore atributes, coulde I ?
If not, maybe you have some idea how to solve my problem?
|
|
|
|
|
could not coulde
|
|
|
|
|
Hi,
I have a dataset with some values from DB. I want to show the dataset as tooltip to a particular control, say a list box. How do I do that.
Thanks in advance.
|
|
|
|
|
ToolTip tp = New ToolTip();
tp.SetToolTip(listbox1, ds.GetXml());
|
|
|
|
|
how can i create a custom control with some properties i can see in property visual studio window when i use it inside a form?
|
|
|
|
|
You have to use fields, you cannot just make variables public:
This will not work:
public int MyInteger=1;
This will:
private int myInteger=1;
public int MyInteger
{
get
{
return myInteger;
}
set
{
myInteger=value;
}
}
If you want variables to be read only, just omit the set accessor:
private int myInteger=1;
public int MyInteger
{
get
{
return myInteger;
}
}
You can adjust the visible attributes in the property designer:
private int myInteger=1;
[Description("A useless number."),Category("Behavior")]
public int MyInteger
{
get
{
return myInteger;
}
set
{
myInteger=value;
}
}
Hope this helps,
DigitalKing
|
|
|
|
|
|
Hi Guys,
First up, my apologies because this is a cross forum post - I just wanted to try it in here as it seems a little busier!
I'm writing a C# application to help configure a Windows CE device (4.2), which I think only supports .Net CF 1.1 (this is a whole other headache at the moment, as I only have .Net 2.0 at the moment).
Part of the spec is to configure RAS phone book entries. Now I've managed to find quite a lot of information on MSDN about the RAS, but it all seems geared towards C++ development, which I haven't looked at in over 10 years, and my skills in that language were never that great anyway.
I wondered if any of you could perhaps point me towards a good guide on using the RAS registry entries from C#; My particular areas of interest are how the Passwords are stored in the registry (I've managed to find the entries in the registry, however they are in binary), whether passwords are encrypted and also how the dial string is stored (especially the extra connection settings "+cgdcont=...".
TIA,
Martin.
|
|
|
|
|
I had posted this question last friday, but havent found a solution yet, so posting it again in case somebody is aware of the solution.
** Original message **
Hello,
This is my code which will convert the ADO resultset to XML in C#.
I actually need the column type, column max length etc also in the xml, like the column type/length of id, loginuserid, deptid, wrkstnid etc.
So I am not sure whether I need to pass some parameters to SqlDataAdapter class while executing the SQL command or the XmlDataDocument class has some methods which would print out the datatype and column length information in the XML. Looked at both the classes, didnt find any method, anybody has any ideas about this? Thanks
DataSet ds = new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
adapter.Fill(ds);
if (ds.Tables.Count>0)
{
_sBody = new StringBuilder("", _bodySize);
//Get xml representation of the dataset
XmlDataDocument srcXML = new XmlDataDocument(ds);
srcXML.Save("c:\\XMLDocument.xml");
....
}
<NewDataSet>
<Table>
<id>1</id>
<LoginUserId>tpmadmin</LoginUserId>
<DeptId>1</DeptId>
<WrkstnId>1</WrkstnId>
</Table>
<Table>
<id>2</id>
<LoginUserId>sysadmin</LoginUserId>
<DeptId>2</DeptId>
<WrkstnId>2</WrkstnId>
</Table>
</NewDataSet>
-----------------------------------------------
** Paul Brower's Reply **
Try this, (with 'ds' being your dataset)
ds.WriteXml(@"c:\thedataset.xml",System.Data.XmlWriteMode.WriteSchema) ;
That will write out all your xml with the schema.
-----------------------------------------------
** Question **
I actually want the max size of the column and I think that information is missing in the XML. The XML looks something like this. Max size of the column is used by the XSL to print the data. For datatypes like int, numeric, datetime I can manage the column lenght, problem arises only when its of type string, char etc
It has the column name, type, minOccurs. I think the max size of the column is missing, do I need to try some other method, or any other argument? Thanks,
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="id" type="xs:int" minOccurs="0" />
<xs:element name="LoginUserId" type="xs:string" minOccurs="0" />
Thanks.
-- modified at 17:47 Monday 8th May, 2006
|
|
|
|
|
Thread[] workerThread = new Thread[someInt];
for(int i = 0; i < someInt; i++)
{
string keyInfo = someKeyInfo().ToString();
workerThread[i] = new Thread(new ThreadStart(DoSomeWork(keyInfo)));
workerThread[i].Start();
}
foreach(Thread t in workerThread)
{
while(t.IsAlive()){}
}
|
|
|
|
|
I didn't think called methods could have parameters in Framework 1.1. The methods used by ThreadStart must be static.
|
|
|
|
|
First point is correct but .Net 2.0 has a new overload for the Thread constructor accepting a ParametrizedThreadStart. Second point isn't true even under 1.1 also 'normal' functions can be used.
|
|
|
|
|
Depending on the number of threads you could consider using ThreadPool.
Also you should rethink the IsAlive loop. First of all it could consume much processor time so you should at least do:
foreach(Thread t in workerThread)
while(t.IsAlive())
Thread.Sleep(10);
Instead of waiting for all threads separately you could also use a counter which counts the started and terminated threads. Have a look at the Interlocked[^] class for a sample.
|
|
|
|
|
Robert is right, just don't go thread crazy. Also, I don't know if it's still an issue on uniprocessor machines but the child thread won't start unless you call Thread.Sleep(0) in the parent after creating it.
|
|
|
|
|
If you are going to do something like that use:
foreach(Thread t in workerThread)
{
thread.Join();
}
I'd only do something like that in a simple console application and I didn't care about the results of the DoSomeWork method. Otherwise I'd use asyncronous delegates and callback methods.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I have several threads, calling the same function.
This function does not access any global stuff... Only variables created inside it.
If I have something like this:
void foo()
{
int x = 100;
}
Is a new instance of x being instantiated for every call a thread makes?
Or is the same instance of x being used over and over...?
|
|
|
|
|
It is declared locally so every thread will have its own value.
|
|
|
|
|
Thank you very much...
I'm new to threading... And I have a bug in my program...
So I just wanted to make sure it's not the reason.
Thanks again...
|
|
|
|
|
Im getting "The Server is not operational" when authenticating user to active directory
Any help plzz...
Thanks in advance
Krishna
|
|
|
|
|
Hi,
I'm displaying a web page in a windows form. Now that the page is displayed, I want to be able to set the cursor to a specific position, and then move it until it reaches another location on the page. The second location has no ID, no name and that is why I'm approching the question like that.
I'm new to C#, so if anybody can help...
|
|
|
|
|
I couldn't realy understand...
Are you looking for a function which sets the cursors position?
If you are, you can use the SetCursorPos API function...
I doubt that there's any .NET implemented function to do this...
Best regards,
Shy
|
|
|
|
|
How would I add text to a listbox and have that text added to the top line instead of the bottom line?
|
|
|
|
|
try doing the same function you do but backwords.
i.e: insted of:
for (int i = 0; i < n; i++)
write:
for (int i = n-1; i => 0; i--)
or
for (int i = n; i > 0; i--)<br />
i-1;
etc...
another way is to use a DataSet to arrange the stuff up... (may be longer)
that's all I can think of (without looking at properties etc...)
yours, NaNg.
|
|
|
|
|
hi JMichael2468!
Instead of using the ListBox's Items.Add method, use the Items.Insert method.
then pass a zero value in the index parameter so it will be added on top of the collection.
i tried it and it works fine with me.
hope this helps!
microsoc
|
|
|
|