Sorting
Hi All,
I have an xml file as listed below. This is a list of scripts. Some of the
scripts depend on the output of other scripts. I want to sort this xml in
such a way that the scripts are listed in the correct order of execution. I
created an IComparer class and implememted the Compare method. I am calling
Array.Sort on an XmlNode array. The sorting is not correct. Can anyone
suggest a correct algorithm for a compare method to sort this XML?
Thanks.
James
<root>
<scripts>
<script>
<name>script0</name>
<sequence>0</sequence>
<references>script6|script14|script20|script4|script24|script16|script9|scri
pt22|script25</references>
</script>
<script>
<name>script1</name>
<sequence>1</sequence>
<references>script0|script6|script14|script9|script25|script15</references>
</script>
<script>
<name>script2</name>
<sequence>2</sequence>
<references>script10|script6</references>
</script>
<script>
<name>script3</name>
<sequence>3</sequence>
<references>script0|script6</references>
</script>
<script>
<name>script4</name>
<sequence>4</sequence>
<references>script6|script20</references>
</script>
<script>
<name>script5</name>
<sequence>5</sequence>
<references>script6</references>
</script>
<script>
<name>script6</name>
<sequence>6</sequence>
<references>
</references>
</script>
<script>
<name>script7</name>
<sequence>7</sequence>
<references>script10|script6|script14</references>
</script>
<script>
<name>script8</name>
<sequence>8</sequence>
<references>script10|script6|script14</references>
</script>
<script>
<name>script9</name>
<sequence>9</sequence>
<references>script7|script8|script10|script11|script2</references>
</script>
<script>
<name>script10</name>
<sequence>10</sequence>
<references>
</references>
</script>
<script>
<name>script11</name>
<sequence>11</sequence>
<references>script14|script6|script2|script10</references>
</script>
<script>
<name>script12</name>
<sequence>12</sequence>
<references>script6|script0</references>
</script>
<script>
<name>script13</name>
<sequence>13</sequence>
<references>script14|script6</references>
</script>
<script>
<name>script14</name>
<sequence>14</sequence>
<references>script6</references>
</script>
<script>
<name>script15</name>
<sequence>15</sequence>
<references>
</references>
</script>
<script>
<name>script16</name>
<sequence>16</sequence>
<references>script6|script20</references>
</script>
<script>
<name>script17</name>
<sequence>17</sequence>
<references>script6|script18</references>
</script>
<script>
<name>script18</name>
<sequence>18</sequence>
<references>script6|script25</references>
</script>
<script>
<name>script19</name>
<sequence>19</sequence>
<references>script6</references>
</script>
<script>
<name>script20</name>
<sequence>20</sequence>
<references>script6|script15</references>
</script>
<script>
<name>script21</name>
<sequence>21</sequence>
<references>script6|script24|script0|script20</references>
</script>
<script>
<name>script22</name>
<sequence>22</sequence>
<references>script6|script15|script24|script20</references>
</script>
<script>
<name>script23</name>
<sequence>23</sequence>
<references>
</references>
</script>
<script>
<name>script24</name>
<sequence>24</sequence>
<references>script6|script25</references>
</script>
<script>
<name>script25</name>
<sequence>25</sequence>
<references>script6</references>
</script>
<script>
<name>script25</name>
<sequence>26</sequence>
<references>script0|script2|script4|script7|script8|script9|script10|script1
1|script14|script19|script18|script20|script24|script25|script16|script5|scr
ipt22|script15|script6|script1</references>
</script>
</scripts>
</root> Tag: How does the DataView.Sort method really work under the covers? Tag: 74387
File.Move and NTFS File Permissions on the Source
I realize that File.Move is a thin wrapper around the Win32 MoveFile
API, so what I'm about to describe I think applies to that API. If NTFS
permissions grant you read access to the source file but deny you the
rights to delete the source file, I believe I've discovered -- much to
my surprise -- that File.Move will copy the file to the target but fail
to delete the source. And do this without returning an error (or
equivalently, in managed code, without throwing an exception).
I've included a tiny console app that I used to test. Does anyone know
if this is expected behavior? I've come across no documentation or
comments to suggest that this is correct.
In my application, this behavior will be problematic -- i.e. if the
source cannot be deleted, I need the call to not do anything. I suspect
I'll have to do the copy and delete as separate calls...
using System;
using System.IO;
namespace MoveTester
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length != 2)
throw new ArgumentException("Usage:
MoveTester <sourcefile> <destfile>");
string File1 = args[0];
string File2 = args[1];
Console.WriteLine("Moving file {0} to {1}", File1,
File2);
try {
File.Move(File1, File2);
Console.WriteLine("Done!");
}
catch (Exception E) {
Console.WriteLine(E.ToString());
}
}
}
} Tag: How does the DataView.Sort method really work under the covers? Tag: 74385
C# LDAP libraries and ASP.NET
Hi All
I am trying to authenticate users against a Novell LDAP v3 using ASP.NET
and C# LDAP classes. I have compiled the files to one assembly and
reference it in my code. My problem is the following: I can connect
successfully to the LDAP server, but as soon as I try to Search or Bind,
the following error occurs - "Server did not return any data". Here is the
code sample:
using Novell.Directory.Ldap;
LdapConnection ldapConn = new LdapConnection;
ldapConn.Connect("192.000.0.00",389); // use proper LDAP Server IP Address
if(ldapConn.Connected)
{
ldapConn.Bind("cn=yourname,ou=IT,ou=WEB,o=ORG","password");
}
PLEASE HELP!!! I really need some HELP here. The LDAP directory has the
following schema or structure: ORG -> WEB -> IT -> user data
I did not find any documentation with the C# LDAP classes and URGENTLY
need some help in searching and binding.
All help is HIGHLY APPRECIATED.
Thank you
Walter Tag: How does the DataView.Sort method really work under the covers? Tag: 74384
.NET Framework AutoUpdater
Some of you might be interested in this open source AutoUpdater for
.NET
"Sharp AutoUpdater provides an auto-update feature for .NET
applications. Using XML configuration files, Sharp AutoUpdater
component detects if there is a new version of the software,
downloads, unzips, and installs the new files."
Link: http://csautoupdater.sourceforge.net/ Tag: How does the DataView.Sort method really work under the covers? Tag: 74382
clipboardformat, Xml Spreadsheet
Can anyone help me with copying spreadsheet format to the clipboard.
I have this text
<Workbook>
<Worksheet>
<Table>
<Row>
<Cell ss:Type="String">MyData</Cell>
<Cell ss:Type="String">MyData</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
I put that into a memorystream (UTF8),
then call
DataObject ob = new DataObject();
ob.SetData("XML Spreadsheet", ob);
Clipboard.SetDataObject(ob, true)
When I try to paste this into excel it complains that it can't paste the
data.
what am I doing wrong? Tag: How does the DataView.Sort method really work under the covers? Tag: 74380
Application Blocks: ExceptionXmlPublisher log viewer?
I'm using the ExceptionXmlPublisher provided by Kirk Evans.
Is there a log viewer or xsl stylesheet to read the xml put out by the
publisher? It's not well-formed xml (no root element) and it's deep.
Any help would be great.
Thanks.
--Mark
majohnson@gr.com Tag: How does the DataView.Sort method really work under the covers? Tag: 74376
Rolling my own Install w/ MSDE
I rolled my own install that checks to see if SQL server is there like so
Dim svc As ServiceProcess.ServiceControlle
Tr
svc = New ServiceProcess.ServiceController("MSSQLServer"
Catch ex As Exceptio
Return ValRetCodes.NotInstalle
Exit Functio
End Tr
Dim startDate As DateTim
If Not IsNothing(svc) The
..
Els
Return ValRetCodes.NotInstalle
End I
Problem... on one user's box it runs, starts MSDE's install, but stops because it found datafiles
C:\Program Files\Microsoft SQL Server\MSSQL\Data\master.md
C:\Program Files\Microsoft SQL Server\MSSQL\Data\mastlog.ld
So my check was fruitless. Is MSDE installed? Is SQL installed? What's a better way to check, and if it's installed, how can I use it for my database, or should I? Tag: How does the DataView.Sort method really work under the covers? Tag: 74375
Software and Hardware Inventory
Hi,
There are some good extensive samples or components that make software and hardware inventory with WMI easy
I'm seeking some examples or WMI class/property listing to catch the components in the machine that mades up a good software/hardware inventory.
Regards
Lucas Ponzo Tag: How does the DataView.Sort method really work under the covers? Tag: 74374
IDisposable.Dispose, Object.Finalize and threads
IDisposable.Dispose is documented as the method where you have to release
unmanaged resources.
Dispose is called by Finalize.
Finalize is called by garbage collector after the object becomes
inaccessible.
The documentation says: "The thread on which the finalizer is run is
unspecified".
So the question is: My object has allocated a [win32] window handle using
CreateWindow (called using P/Invoke) and has to destroy it. But Win32 SDK
say that DestroyWindow has to be called from the same thread that called
CreateWindow. This seems impossible given Dispose/Finalize/GC patern.
Any advice ?
btw: Let me know if I should post to another group.
--
francois.piette@overbyte.be
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be Tag: How does the DataView.Sort method really work under the covers? Tag: 74373
question about paging in Datagrid
question about paging in Datagrid.
i would like to ask, normally, we bind the datagrid with DataSet
if a query like "select * from item" contains 1000000 records, it seems that
getting all the records and load it in the memory(DataSet) is a
resource-consuming task. (please correct me if i say something wrong)
So, i was planning to connect to database and fetch 10 items each time, when
page is changed, connect to database again and fetch next 10 items.
Is my planning a good way to save the resources? or Paging in datagrid has
done something to save the resource? Tag: How does the DataView.Sort method really work under the covers? Tag: 74372
Using Help remotely
Hi,
I have a client program that is one touch installed and hosted on an IIS server.
My question is, what is the best way to provide user interface help to the client program.
Two ideas have come to mind.
1) - Let the client program download the .chm and reference it locally. This is probably a pain.
2) - Let the client do remote calls to the server to request the help and the server then returns the requested help info. Not
really sure exactly how I would make that work.
Since I am not sure that either of these ideas is really workable, there must be a third and correct way. Would someone please
enlighten me as to what it is?
Thanks
-------------------------------------------
Roy Chastain
KMSystems, Inc. Tag: How does the DataView.Sort method really work under the covers? Tag: 74370
How to cancel a pending BeginReceive ?
What is the proper way to cancel a pending BeginReceive/EndReceive ?
Can it be done without generating an exception ?
Currently I shutdown and close the socket. The blocking "EndReceive"
throws System.ObjectDisposedException.
I try to avoid throwing exceptions when ever possible, and reserve
them for unanticipated problems. Trying to stop a background
read/process loop is an anticipated activity. For me the debugger
delays 15 seconds when ever an exception is thrown. But regardless, I
am hoping for a cleaner approach. I can not find guidance on this
issue in framework documentation.
Forgive the cross posts. It would be nice to have a specific
framework/network related NG.
Thanks for any insight - Best regards - Lee Gillie - Spokane, WA Tag: How does the DataView.Sort method really work under the covers? Tag: 74367
how to embed xml data in resx file
Hi,
I am trying to embed xml data within resx file without success. Here's
my data tag -
<data name="foo" type="System.String, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value><![CDATA[ <myroot><otherdata>blah..<otherdata></myroot>
]]>
</value>
Even though I have used CDATA section, I get "blah..." when I try to
access "foo" as opposed to my xml data "<myroot>.....</myroot>".
Thank you.
Regards,
Amitava Shee Tag: How does the DataView.Sort method really work under the covers? Tag: 74364
Signing Assemblies
Using VS .Net 2003
1. I'm confused on how to remove compile errors below.
Not sure if I need/how to use Al.exe and Gacutil.exe tools
with VS, etc.
2. My company doesn't have a private key and the local
windows application I'm creating is for internal company
network use only. Should I create a public key?
3. My goal is to compile a Release version of the
application to the network and then use caspol tool to
trust assembly. Make Sense?
Steps:
(a) Created key pair (sn -k foo.snk) and copied foo.snk
to C# project \obj directory (is my next step: sn -p
foo.snk fooPub.snk & AssemblyDelaySign(true) &
AssemblyKeyFile (fooPub.snk) ???)
(b) Changed AssemblyInfo.cs contents:
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"C:\...\obj\foo.snk")]
[assembly: AssemblyKeyName("")]
(c) Resulting compile errors (2):
Assbly gen. failed -- Ref assbly 'Interop.Word'
& 'Interop.Excel' no strong name
Thanks - Steve Tag: How does the DataView.Sort method really work under the covers? Tag: 74363
HELP-Sorted Datagrids and modal dialogs
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data of the selected row in textboxes on dialog that execute by the user press a button. The following code works if I do not sort the datagrid before I press the button to bring up the dialog. It is when I sort it the datagrid I have the issue
private void Frm_CustomerAU_Load(object sender, System.EventArgs e
Frm_Customers frmCustomers= (Frm_Customers) this.Owner;
CurrencyManager currencyMgr = (CurrencyManager)this.BindingContext[frmCustomers.tableInfoDG.DataSource, "Table"]
currencyMgr.Position = frmCustomers.tableInfoDG.CurrentRowIndex
DataRow currentRow = ((DataRowView)currencyMgr.Current).Row
txtBxCompanyName.Text= currentRow["CompanyName"].ToString()
I have also tried using the following code to bind the table to the textbox and I get the same result
txtBxCompanyName.DataBindings.Add("Text", frmCustomers.tableInfoDG.DataSource, "Table.CompanyName")
I believe it has something to do what I am setting CurrencyManager position to ( currencyMgr.Position = frmCustomers.tableInfoDG.CurrentRowIndex;). I know I need it to be the position of the underlying table in order to get the selected position in the datagrid. I just do not know how to get the position. By the way, this is C
Any help would be greatly appreciated Tag: How does the DataView.Sort method really work under the covers? Tag: 74362
Send fax
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C432C1.27424D30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all.
This is my cod to send a fax
FAXCOMLib.FaxServerClass fxsvr =3D new FAXCOMLib.FaxServerClass();
FAXCOMLib.FaxDocClass fxdoc;
try
{
fxsvr.Connect("\\testpc"); // null for local fax server otherwise a =
computername
fxdoc =3D (FAXCOMLib.FaxDocClass)fxsvr.CreateDocument(@"c:\test.txt");
fxdoc.FaxNumber =3D "0269446970";
fxdoc.Send();
fxsvr.Disconnect();
}
catch (Exception ex )
{
Console.WriteLine( ex.ToString());
}
The problem is that the fxsvr.CreateDocument throws an =
System.Runtime.InteropServices.COMException
exception with the message of "Unspecified error".
Does anybody know why that?=20
------=_NextPart_000_0008_01C432C1.27424D30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi all.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This is my cod to send a =
fax</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<P><FONT face=3DArial size=3D2>FAXCOMLib.FaxServerClass fxsvr =3D new=20
FAXCOMLib.FaxServerClass();</FONT></P>
<P><FONT face=3DArial size=3D2>FAXCOMLib.FaxDocClass fxdoc;</FONT></P>
<P><FONT face=3DArial size=3D2>try</FONT></P>
<P><FONT face=3DArial size=3D2>{</FONT></P>
<P><FONT face=3DArial size=3D2>fxsvr.Connect("\\testpc"); // null for =
local fax=20
server otherwise a computername</FONT></P>
<P><FONT face=3DArial color=3D#ff0000 size=3D2>fxdoc =3D=20
(FAXCOMLib.FaxDocClass)fxsvr.CreateDocument(@"c:\test.txt");</FONT></P>
<P><FONT face=3DArial size=3D2>fxdoc.FaxNumber =3D =
"0269446970";</FONT></P>
<P><FONT face=3DArial size=3D2>fxdoc.Send();</FONT></P>
<P><FONT face=3DArial size=3D2>fxsvr.Disconnect();</FONT></P>
<P><FONT face=3DArial size=3D2>}</FONT></P>
<P><FONT face=3DArial size=3D2>catch (Exception ex )</FONT></P>
<P><FONT face=3DArial size=3D2>{</FONT></P>
<P><FONT face=3DArial size=3D2>Console.WriteLine( =
ex.ToString());</FONT></P>
<P><FONT face=3DArial size=3D2>}</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>The problem is that the <FONT=20
color=3D#ff0000>fxsvr.CreateDocument </FONT>throws an=20
System.Runtime.InteropServices.COMException</FONT></P>
<P><FONT face=3DArial size=3D2>exception with the message of =
"Unspecified=20
error".</FONT></P>
<P><FONT face=3DArial size=3D2>Does anybody know why that? </FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P></DIV></BODY></HTML>
------=_NextPart_000_0008_01C432C1.27424D30-- Tag: How does the DataView.Sort method really work under the covers? Tag: 74355
compacframework
Hi!
I want develop an app for pocket pc that use IPv6, and I have installed
VStudio .NET 2003, but it hasn't projects for PPC 2003, (PPC 2002 hasn't
support for ipv6). Is it possible install some for have PPC 2003 (service
pack, ...)?
Thanks! Tag: How does the DataView.Sort method really work under the covers? Tag: 74351
How to map network drive in C#?
hihi
when I am using Platform SDK, I can use WNetAddConnection2 to connect the network drive. But i cannot found these similar function or method in C#. Anyone know C# has this class to do it?
thx... Tag: How does the DataView.Sort method really work under the covers? Tag: 74347
Changing reference from 1.0 framework dll's to 1.1 framework dll
Hello,
I am developing an application using ASP.NET and ORACLE. Initially I loaded Visula studio . NET 1.0 framework and later updated it Framework 1.1 . So, now, I got two different directories "WINNT\Microsoft.NET\Framework\v1.0.3705" and "WINNT\Microsoft.NET\Framework\v1.1.4322", in my system holding dll's. At present, this application is referencing to 1.0 Frameworks dlls (e.g. system.dll,system.data.dll etc). But, now I want to change this reference to access dl's from 1.1 framework so that I can use other useful methods and features. For this, When I removed the reference of existing dll and then tried to add NEW reference of dll's from 1.1 framework directory, I am getting MANY compilation error. Could any one help me to resolve this problem? My goal is to change the reference of dll's to access 1.1 framework's dll instead of 1.0.
Regards,
Ajay
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching. Tag: How does the DataView.Sort method really work under the covers? Tag: 74345
Running the backup utility programaticly
Hi ,all
is there a way to run NtBackup from vb.net. I know i can use shell ,proccess
or Win32API. But what is best and how to do it.
TIA Tag: How does the DataView.Sort method really work under the covers? Tag: 74343
Send fax
Does anybody know how to send a fax from c#.
Is there any suppport for sending faxes?
Thanks Tag: How does the DataView.Sort method really work under the covers? Tag: 74342
Pound sign and everthing following are get lost when using QueryString for value transfering in ASP
(Type your message here)
I have two asp script files A.asp and B.asp.
In A.asp, I am doing database query. The query string looks like
"SELECT * From Where PublishDate Between #02-02-04# And #03-03-04"
I tried to using QueryString to transfer the query string to B.asp.
The statement looks like
Sql = "SELECT * From Where PublishDate Between #02-02-04# And #03-03-04"
<a Href="B.asp?QueryString=Sql">XXXX</A>
However, it turned out that the first # and everything following got lost
Anybody could help!
Thanks in advance!
Yong Chen
HKU, CSIS
--------------------------------
From: Yong Chen
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>L5cSB89+t0eNfdbhCkjJgQ==</Id> Tag: How does the DataView.Sort method really work under the covers? Tag: 74338
Using DSOleFile to read double-byte character file
Hi,
I am using DSOleFile to access double-byte character file property
information but it does not seem to retrieve the information correctly. Can
someone tell me how to use the DSOleFile.exe to access double-type character
file property information?
Thanks in advance. Tag: How does the DataView.Sort method really work under the covers? Tag: 74333
Problem with WebProxy class
I recently encountered a problem with the following piece of code in
an ASP.NET application that has been running successfully for a couple
of months. It requests a web-page from an external web-site, using
our corporate proxy.
Our company has two proxy servers with the same DNS name. If you
execute the nslookup command (at the Windows command prompt), two IP
addresses are returned. When one of the proxy server crashes (as it
did the other day), Internet Explorer continues to work correctly.
However my code failed until the dead proxy server was fixed. It
seemed to cache the IP address of the failed proxy server and continue
to try and use that machine rather than switching to the live machine.
Is there anything I can do to stop this behaviour?
Here is the code:
HttpWebRequest hwrRequest = (HttpWebRequest)WebRequest.Create(
IntranetConfiguration.ExternalSystemConnectionStrings[sExternalSystemKey]);
hwrRequest.Timeout = REQUEST_TIMEOUT;
//Set up proxy information
hwrRequest.Proxy = new WebProxy(
IntranetConfiguration.Proxy.Address,
IntranetConfiguration.Proxy.Port);
hwrRequest.Proxy.Credentials = new NetworkCredential(
IntranetConfiguration.Proxy.Username,
IntranetConfiguration.Proxy.Password);
//Go and get text response from Shareprice service
HttpWebResponse hwrResponse =
(HttpWebResponse)hwrRequest.GetResponse();
Stream strResponse = hwrResponse.GetResponseStream();
StreamReader srResponse = new StreamReader(strResponse);
sHtmlText = srResponse.ReadToEnd(); Tag: How does the DataView.Sort method really work under the covers? Tag: 74328
CSharpCodeProvider.CreateParser
Are there any plans to implement a parser for CSharp code? - I could really use it! Tag: How does the DataView.Sort method really work under the covers? Tag: 74321
Urgent: Help to set Encoding for OracleDataReader
Hi
I'd like to set Encoding to OracleDataReader/OracleCommand or relative class (just like StreamReader class constructor). Is that possible
Thank
Peter Tag: How does the DataView.Sort method really work under the covers? Tag: 74320
Migrating Windows Forms to ASP.NET
is there an easy way to convert a Windows Forms app to an ASP.NET one? I
understand there are UI and control differences which may arise but, in general,
is this an easy conversion?
Thanks.
samantha. Tag: How does the DataView.Sort method really work under the covers? Tag: 74307
Cannot open ASP.NET projects on IIS 6/ Win2k3 running WSS
Hi,
I have a Windows 2003 server running Windows Shareporint Services 2.0.
After I installed WSS I am to able to open any web project that is located
on my default web site from VS 2003.
I can't borwse to the site either. It is as if the site does not exist.
Does anyone know how I can fix this issue?
The configuration that I am running is
Windows 2003 server
WSS 2.0
.NET framework 1.1
VS.NET 2003
TIA Tag: How does the DataView.Sort method really work under the covers? Tag: 74303
Memory/Leak Tool?
I have a Windows app (it will be promoted to a Service once this problem is
sorted out) that cyclically, every minute, connects to five SQL Servers over
the WAN, extract data and insert the data in a local SQL Server, using the
OLEDB provider. Every cycle I create one local connection and five remote
connections, do the stuff, close the connections and dispose everything that
has a Dispose method (OleDbConnection, OleDbDataAdapter and OleDbCommand).
After running overnight the performance degrades and if I examine the
Private Bytes of the process (using Performance Monitor, the way we looked
for memory leaks before DOTNET in C++, but should still be valid), it goes
up from approx. 1.3 MB to over 2 MB.
I've been using DOTNET from the first Beta and never thought I'd say this,
but I suspect a leak.
Is there a method/tool that will show me the type of DOTNET objects being
leaked, or give me some indication of where to look for the problem?
Thanks. Tag: How does the DataView.Sort method really work under the covers? Tag: 74302
StrongNameIdentityPermission do not working with WinForm
I'm invoking the same Dll from Console application and WinForm application
Both signed with SrongName.
the class that I'm invoking is protected with StrongNameIdentityPermission
Demand
and hear is what happened:
the console application pass the demand but the WinForm failed
i had try to union the StrongNameIdentityPermission blob with the mscorlib
StrongName
but it still behave is the same way.
Do someone know to solve this issue ????
TNX
Bnaya Eshet Tag: How does the DataView.Sort method really work under the covers? Tag: 74300
Finding process user identity
Hi
I am using the System.Diagnostics.Process class to find information about the running process on, lets say win2k. I can get to almost all the information I need from the Process object except the user name that the process is running as. In the Task Manager, I can see the process Image Name, User Name, CPU, etc. Here is the code example of what I am doing
Process[] procs = null
string processList = ""
procs = Process.GetProcesses()
for(int i = 0; i <= procs.GetUpperBound(0); i++
Console.WriteLine(procs[i].ProcessName.ToString() + " is still responding!")
The question is, how can I get to the User Name for a specific process? Do I have to use Win API to do this
Cheers. Tag: How does the DataView.Sort method really work under the covers? Tag: 74299
dispaly group button name in taskbar
When my c# app appear as in individual buttons in the XP taskbar, the button
text is correct. However when Windows XP group groups the buttons together.
the combined button is blank. How can I fix it? Tag: How does the DataView.Sort method really work under the covers? Tag: 74293
Arabic Strings
Hello,
how could i go about replacing normal latin numerals in a string containig
arabic characters.
Using the string builder when i append the numerals come in front of the
arabic characters.. and not after the arabic characters..
What is the suggested method to do this..
Regard
Sajay Tag: How does the DataView.Sort method really work under the covers? Tag: 74288
Thread question
Child threads aren't allowed to touch main thread objects. The session
object in ASP.NET belongs to the main thread. The way around this is to pass
in a reference in the thread constructor so that the child thread can use
the object safely since there is no control.invoke available like in
winforms.
Why does this work? This has been bugging for a while.
So the class would look something like this:
public class test
{
public test(HttpContext currObject);.....
and the call would be test t = new (HttpContext.Current);
Technically, I can't see what is happening behind the scenes to force thread
safety. Anybody?
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok Tag: How does the DataView.Sort method really work under the covers? Tag: 74287
string, GetHashCode, and uniqueness
hi all,
msdn says:
"the implementation of GetHashCode provided by the String class
returns unique hash codes for unique string values."
source:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemobjectclassgethashcodetopic.asp
sure, hashes must try to yield good distribution but
how could uniqueness be guarranteed in this case?
is it best effort? is it under certain conditions?
GetHashCode returns an int and so it is limited to a 32-bit
number. that's a big number but there are infinite
varieties of strings. just imagine a, aa, aaa, aaaa, aaaaa,
ad infinitum. and that's just using the letter 'a'.
thanks in advance for clarification,
rh Tag: How does the DataView.Sort method really work under the covers? Tag: 74286
How to stop users from clicking buttons more than once?
I have a C# asp.net page that when you click a button, it writes a record
(based on entered values) to the database. I've found that if you click the
button multiple times quickly, multiple records are written. What is the
best way to deal with this? The page takes a few seconds to process after
the button is clicked so it doesn't reach the point to be reloaded with the
button disabled. I tried disabling it with Javascript, but then the server
side events didn't fire. I tried setting a session variable as soon as the
button was clicked and only running the code if the variable was not set,
but that didn't work either. What is the best way to do this?
Thanks, Tag: How does the DataView.Sort method really work under the covers? Tag: 74283
wsdl.exe and Nillable Value Types
I am attempting to use wsdl.exe to generate a Web Service Client in C#
from a valid WSDL file generated by Apache Axis.
My application requires the ability to distinguish between an
unspecified value and a specified value. For that reason, the WSDL
that is generated by Apache Axis utilizes 'nillable="true"' to permit
Web Services Clients to indicate a value or specify 'nil'.
The problem I am having with .NET and wsdl.exe (that I did not have
with Apache Axis and Java Web Services Developer Pack) is with Value
Types.
Here is a portion of the WSDL presenting a problem:
<complexType abstract="true" name="Type">
<sequence>
<element name="localId" nillable="true" type="xsd:string"/>
<element name="id" minOccurs="0" maxOccurs="1" nillable="true"
type="xsd:int"/>
</sequence>
</complexType>
When wsdl.exe generates its class from this, it creates the following:
public abstract class Type {
public string localId;
public int id;
}
The problem is that the "int" is a Value Type that is incapable of
storing null. I have tried the following all to no avail:
1. Replacing 'type="xsd:int"' with 'type="soapenc:int' (which made
Java WSDP work)
2. Including/Removing 'minOccurs' and/or 'maxOccurs'
3. Manually replacing 'public int id' with 'public SqlInt id' (SqlInt
is not the correct name, but its the one from the SQL namespace that
is used to support nulls for ints in the DB ... .NET barked at me when
I attempted to use this telling me it can't be used for XML
serialization or some such thing).
I am out of ideas and wondering if you can guide me to a way to AVOID
having .NET pass a zero(0) when this attribute is not specified (which
is what it currently does for Value Types). I was hoping to find the
equivalent of java.lang.Integer (which can be null) in C# but have had
no success.
One last note: This WSDL will be consumed by clients who purchase the
software I am developing. They will be responsible for generating
their own Web Service Clients using the toolkit of their choice, so I
am trying to make it as standardized as possible while requiring
minimum client intervention/recoding when they generate the Web
Service client.
Thanks in advance for any suggestions.
Erik Tag: How does the DataView.Sort method really work under the covers? Tag: 74282
wsdl.exe and Two-Dimensional Arrays
I am attempting to use wsdl.exe to generate a Web Service Client in C#
from a valid WSDL file generated by Apache Axis.
There appear to be a problem recognizing a 2-Dimensional Array that
did not present a problem for the Apache Axis Toolkit or Java Web
Services Developer Pack Toolkit when they generated the client code.
"GridField" represents a 2-Dimensional Array of "Field". Here is a
snippet from the WSDL describing it.
<complexType name="GridField">
<complexContent>
<extension base="tns4:Field">
<sequence>
<element name="fields" nillable="true"
type="impl:ArrayOfArrayOf_tns4_Field"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="ArrayOfArrayOf_tns4_Field">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns4:Field[][]"/>
</restriction>
</complexContent>
</complexType>
<complexType abstract="true" name="Field">
<sequence>
<element name="name" nillable="true" type="xsd:string"/>
<element name="metaData" nillable="true" type="tns5:MetaData"/>
</sequence>
</complexType>
When wsdl.exe creates the Web Service Client code in C#, it generates
the following:
[System.Xml.Serialization.SoapTypeAttribute("GridField",
"urn:fields.axis.webservices.sparta.com")]
public class GridField : Field {
public Field[] fields; // Note: Only 1 Dimensional Array
}
I then go in and modify it to be "Field[][]" and all works fine.
Is there an explanation / workaround for this? Tag: How does the DataView.Sort method really work under the covers? Tag: 74280
Determine Assembly's .NET Framework Version
Hello,
If I have a .NET assembly, how do I determine what version of the .NET
framework it....
1) was compiled against
2) is supposed to use
3) is compatible with?
Is there a utility that will extract this info somehow?
thanks!
-ZD Tag: How does the DataView.Sort method really work under the covers? Tag: 74275
Delegate and Thread Problem
I have a Delegate based Project that contain classes whose purpose is to
instantiate objects of another Project (or Library) using Delegates. I have
a client application that uses this Delegate based project to call library
method asynchronously. Delegate based project returns the control to the
client immediately and so the client can perorm other tasks. Every thing
works fine but soon as i close the client application, the back ground
processing also ends. In other words, the Delegate based project and library
Project also stops. why is that? How can i call method using delegate that
continue the processing even if the client application terminates.
I can work around this scenario by creating threads and calling method in
thread. My client application calls the method of a project named
ThreadCreator. The ThreadCreator in turn creates a new thread and calls the
appropriate library method in that thread. Now even if the client
application terminates, my processing continues. The problem with this
approach is that my ThreadCreator project cant call method that takes
parameters. The work aournd here is to go for statefull object, but my
library objects are all stateless. How can i call method using thread that
takes parameters ?
Please answer for both scenario
Regards,
Irfan Tag: How does the DataView.Sort method really work under the covers? Tag: 74273
PLEASE HELP!!! LDAP authentication
Hi All
I am trying to Authenticate a user from Novell LDAP using the code below. I
can successfully Connect to the LDAP Server, but get the following error
message as soon as I hit the search command:- (a) Server did not send any
data.
Imports System
Imports System.Text
Imports System.Collections
Imports System.DirectoryServices
Public Function AuthenticateUser(ByVal Username As String, ByVal Password As
String) As Collection
Dim dirSearch As New DirectorySearcher
Dim resultSet As SearchResultCollection
Dim result As SearchResult
Dim resultFields() As String = {"SecurityEquals", "cn"}
With dirSearch
.SearchRoot = New DirectoryEntry("server1.com", "username",
"password")
.PropertiesToLoad.AddRange(resultFields)
.Filter = "cn=*"
End With
Try
resultSet = dirSearch.FindAll()
If (resultSet.Count > 0) Then
For Each result In resultSet
'// display results here
Next
Else
'// display error message
End If
Catch ex As Exception
throw ex
Finally
dirSearch = Nothing
End Try
End Function Tag: How does the DataView.Sort method really work under the covers? Tag: 74268
Write and Read a file html
I have a file Reportcontrolli.html...I must read it...find and replace a word...and write in another file Reportcontrolli1.htm
My following code don't write
Public Function ScriviTesto(ByVal testo As String
Dim s As Strin
Dim MyFileRead As FileStrea
MyFileRead = New FileStream(m_PathFiles + "Reportcontrolli.html", FileMode.Open, FileAccess.Read
Dim textFile As New StreamReader(MyFileRead
s = textFile.ReadToEn
s = s.Replace("*RIFCOMPLETI*", testo)
MyFileRead.Close(
Dim Myfilewrite As FileStrea
Myfilewrite = New FileStream("c:\Reportcontrollicopia.html", FileMode.Create, FileAccess.Write
Dim writeFile As New StreamWriter(MyFilewrite
MyFilewrite.Write(s
Myfilewrite.Close(
In the string 's' there is the correct html with a word already replaced......so the read is good but the file html created is empty
Can you help me
Thank yo
cos75 Tag: How does the DataView.Sort method really work under the covers? Tag: 74262
Scaling Performance Counters
I have an application that is publishing some PerformanceCounters. How do I set the default scaling that will be used when
PerfMon looks at my counters?
Thanks
-------------------------------------------
Roy Chastain
KMSystems, Inc. Tag: How does the DataView.Sort method really work under the covers? Tag: 74261
Merge directory names
How can I merge two directory names? First path is always absolute and second is relative.
For example:
1) c:\MyTest\Privat
2) ..\Share
And I need result: c:\MyTest\Share Tag: How does the DataView.Sort method really work under the covers? Tag: 74258
Problem using public CComObjectRootEx and templates
When switching from VC7.0 to VC7.1 I've encountered a problem:
I have a plugin class like
class ATL_NO_VTABLE CDataFlowPlugIn :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CDataFlowPlugIn, &CLSID_DataFlowPlugIn>,
public IPreferencesEventSink,
public:
CDataFlowPlugIn();
DECLARE_NO_REGISTRY()
BEGIN_COM_MAP(CDataFlowPlugIn)
COM_INTERFACE_ENTRY(IPlugIn)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPlugInWorkspaceEventSink)
COM_INTERFACE_ENTRY(IPreferencesEventSink)
COM_INTERFACE_ENTRY(IFrameSystemEventsEventSink)
END_COM_MAP()
...}
I have linker errors in module:
DataFlow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
(__imp_?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@
QAEKXZ) referenced in function "public: virtual unsigned long __stdcall
ATL::CComObject<class CDataFlowPlugIn>::AddRef(void)"
(?AddRef@?$CComObject@VCDataFlowPlugIn@@@ATL@@UAGKXZ)
Engine.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
(__imp_?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@
QAEKXZ)
DataFlow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalRelease(void)"
(__imp_?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@
@QAEKXZ) referenced in function "public: virtual unsigned long __stdcall
ATL::CComObject<class CDataFlowPlugIn>::Release(void)"
(?Release@?$CComObject@VCDataFlowPlugIn@@@ATL@@UAGKXZ)
Engine.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalRelease(void)"
(__imp_?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@
@QAEKXZ)
..\..\Release\bin\DataFlow.dll : fatal error LNK1120: 2 unresolved externals
For example such line as
OBJECT_ENTRY_AUTO(CLSID_DataFlowPlugIn, CDataFlowPlugIn)
makes unresolved linker error in ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
In VC6.0 and 7.0 this problem was solved like said in microsoft KB article -
class __declspec(dllimport) CComObjectRootEx<CComSingleThreadModel>;
But now compiler was changed and I can't find a wat to make it all linking
normally. Even nobody in office can't now.
It looks like the template class CComObjectRootEc functions must have code
generated for instance in CComSingleThreadModel but there is no code
actually.
What can be done here?
Eugene Tag: How does the DataView.Sort method really work under the covers? Tag: 74255
writing to the event log from a service
hi
i'v created a service that do nothing except writing to the log event from a
timer event. but it did not
the started and stopped succesfully logs do show in the applaction log.I
created a windows form app that do the same...and it worked!?
i tried all posible account property...here is the code from my timer event
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
' Create an EventLog instance and assign its source.
Dim myLog As New EventLog
myLog.Source = "Service1"
myLog.Log = "Application"
' Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log." & vbCrLf & Now.ToString)
end sub
i tried using the service eventlog like this:
Me.EventLog.WriteEntry("Service 1 stopped succesfully at:" & vbCrLf &
Now.ToString, EventLogEntryType.Warning, Now.Millisecond)
it did not work either
then i set the autolog property to false and wrot from onstart and onstop to
the log and IT WORKED!! but not from the timer event:(
is it security or WHAT?!
please help
TIA
Majed Tag: How does the DataView.Sort method really work under the covers? Tag: 74245
Exception Handling
Hai al
I am developing a small application in which all exceptions are handled by a custom exception class which will show a dialog box with all details of error.This one works fine when i run my application from Visual studio IDE.But it doesn,t work when i deploy it on the same machine after making a setup project.Why it is so any idea
Thanks Tag: How does the DataView.Sort method really work under the covers? Tag: 74240
WebRequest without IE dependency
Hi,
I would like to know how to use WebRequest without IE dependency. I know
that if I has my own proxy setting via WebProxy, it will use value from
WebProxy. But how can I do if I want to set my program with no proxy when
IE has its own proxy settings.
Thanks in advance,
Thana N. Tag: How does the DataView.Sort method really work under the covers? Tag: 74237
Typecasting problem
Greeting,
We have a component featuring "late/dynamic-binding". Its being used
by 2 app, with only the 2nd giving a weired problem.
...
objAssembly = Assembly.LoadFrom(strAssemblySource);
objInterface = (InterfaceX)
m_objAssembly.CreateInstance(strClassName);
...
It worked well for 1 app, but at 2nd app, the objInterface always a
"null", and no error, until its method being executed.
objAssembly - is a (supposed) GAC stuff, as well as the objInterface.
they show up in the GAC list as expected.
The only way so far I can workaround this is by placing the interface
assembly within the 2nd app bin folder. But such is not the case for
1st app.
I debugged all checked:
- the (windows) identify used to invoke this component is identical.
- shouldn't be security issue, as the same also being applied for 1st
app.
the apps are asp.net wep app, all developed with c#.
Can anyone help in this one? Tag: How does the DataView.Sort method really work under the covers? Tag: 74234
Thead APIs
So the .NET Thread class has a name property but the ProcessThread class
does not. And the ProcessThread class has an id property but the .NET
Thread class does not. That's just strange. You can get the thread id from
AppDomain.GetCurrentThreadId() but it seems logical that it would be
accessible through the Thread class.
I created a bare-bones Console C# app. and listed the process threads using
GetCurrentProcess().Threads. There were like 5 or 7 threads created! What
are all those threads for? Tag: How does the DataView.Sort method really work under the covers? Tag: 74233
How does the DataView.Sort method really work under the covers?
I know that it sorts a dataview, but what kind of sorting algorhythm is
actually used?
"anon" <anon@hotmail.com> wrote in message
news:eYkxqNvMEHA.3940@tk2msftngp13.phx.gbl...
> How does the DataView.Sort method really work under the covers?
>
> I know that it sorts a dataview, but what kind of sorting algorhythm is
> actually used?
>
> Thanks.
>
>