Answer Questions
Paul B - Miami Finalizer guarantees for access to other objects
When a finalizer runs are there any gurantees that any other object has not already been finalized This would include another object to which a reference in the finalizer's class still exists or a public static object in the finalizer's class, or any other class. Plop69 wrote: nope, there aren't. Let say you have a object A, that have 2 private members of types B & C. B & C do not have a finalizer in my example public class A { private B _b = new B(); private C _c = new C(); public A(){} ~A() { //here in my finalizer i want to use _b en _c } } static void Main() { A a = new A(); System.Threading.Thread.Sleep(5000); a = null; GC.Collect() } let's sa ...Show All
Joe Sanders Changing Username to configure security settings...
Hello all. I'm trying to change my username so that I can configure my security settings but everytime I login I see john's computer/john. I know that you can't have a ' in username. I have changed this on my computer but it doesn't seem to be recognizing it on VWD. Can anyone help with this Thanks. I assume you are talking about SQL Server. Sit on the console locally and logon to Windows as an administrator. Windows Administrators are SQL sysadmins by default. Then you should be able to modify/delete your stale SQL login. Zlatko ...Show All
Diamantregen How is data sorted in ADO.NET?
Hi Guys, Basically, I have a table in SQL server that I insert into a datatable. From the datatable, I use a For Each loop to cycle through each element, do some logic, then insert the current row into another table. The order in which the rows are inserted into the target table is crucial to the success of the package. The select statement is a simple query that does not use any sorting. For example, I have a source table (with a clustered index) like this: ID Descr 1 A 2 B 3 C Now after I select all the rows into my datatable, I want to insert them again to another target table in the order I got them. If the row with ID =3 is inserted before 2, then the package fails. Now my ...Show All
Henrik Dahl Reducing memory usage with XslCompiledTransform
I've currently been using and XslCompiledTransform in my software to apply an XSL stylesheet to a user-provided XML file and then bulkloading the resulting file into a SQL table. This worked great until an XML file larger than 100 MB is thrown into the mix. The RAM usage jumps off the charts and for most users, my program exits will an OutOfMemory Exception. I've looked for ways to get around this and cannot seem to find any solutions. What can I do differently or what other alternatives do I have other than physically parsing through the XML file line by line (or node by node) and performing the operations the XSL file does myself... which is my LAST option considering I am sometimes dealing with 2GB and 3GB XML files. Oh.. and here's ...Show All
JackTripper subquery doesn't work (using VC#, *.csv, ADO.NET , OLEDB)
hi, I have a query like the following, SELECT [GATEWAY],[IPADD], Mobile, Dhaka, NWD, TOTAL FROM [rawdata.csv] where CVDate([START]) >= '7/29/2006' AND CVDate([END]) <= '8/23/2006' AND [GATEWAY] IN (SELECT [GATEWAY] FROM [clients.csv] WHERE [CLIENT]='MR. XXX') GROUP BY [GATEWAY],[IPADD] ORDER BY [GATEWAY] it returns no rows. but I loaded all the csv files in MySQL. then the equavallent query for the above sql returned results. what is the problem did I mistake or I have the problem with conception Thank You Shiplu hi, I am extremly sorry for this kind of question. I got the problem. its in [clients.csv]. [GATEWAY] column and [CLIENT] column was altered. I’m surprised that you are not getting an error. It’s invalid ...Show All
GeorgeBush Binding to BindingSource
Hi, I have a complex object that has a List<T> that contains a List<T> too. I would like to bind this object to a BindingSource and use the BindingSource.DataMember to reach the inner List<T>. In the documentation I found the IListSource interface that looks perfect for this task so my object implements this interface. In my implementation bool IListSource. ContainsListCollection { get {return true;} } But if I run this code the DataMember has no affect and the BindingSource is binded to the public propertys of the outter List<T>. I put a breakpoint to the ContainsListCollection{} property but it is not hit at all. What is wrong ...Show All
Ed Allison Random IOExceptions when using .NET apps on an NLB cluster accessing a file share
We have a situation where we get random IOException errors for a shared drive. We have a MS NLB cluster of 3 accessing a failover cluster for file servers. We randomly keep getting IOExceptions for no reason we can find. The path it complains about when checked manually is valid. Its as if the cluster is "asleep" then slowly wakes up and is "visible" again after a bunch of attempts. There is no appearent pattern to this we can identify - except it usually occurs after prolonged periods of inactivity. But, again, this isn't always the case. Curiously when we reduce the NLB to a cluster of 1 no exceptions are thrown regardless of the machine. Combinations of two or more machines cause trouble. The only other way to ...Show All
GB_2007 Asynchronous Receive Method and Threads
Hello All, I have Asynchronous method to read bytes from the network stream. I wrote below code 2 months ago, now when I come back, I wonder why I used "while(true)" for backgroundWorker. Are there any alternative method to use asynchronous read method with backgorundworker Or the method written below is OK receiveBackgroundWorker.DoWork += new DoWorkEventHandler(Receive); private void Receive(object sender, DoWorkEventArgs e) { while (true) { dataTransfer.Reset(); clientStream.BeginRead(receiveBuffer = new byte[socket.Available], 0, socket.Available, new AsyncCallback (AsyncReceiveDataCallback), clientStream); dataTransfer.WaitOne(); } } private void AsyncReceiveDataCallback ...Show All
Alejandro B mem usage keeps growing :(
Hi, Its a very simple app. When you click a button it will scan a specified directory for *.mp3 files: DirectoryInfo di = new DirectoryInfo(directoryTxt.Text); FileInfo[] fi = di.GetFiles("*.mp3", SearchOption.AllDirectories); and for each file, is gonna create an object of structure type Mp3File (simple struct with just 4 string fields for name, title, artist and album): for (int i = 0; i < fi.Length; i++) { Mp3File m = ID3Reader.ReadID3Tags(fi[ ].FullName); this.progressBar.PerformStep(); } the Mp3File object is given by the ReadID3Tags method which goes like: public static Mp3File ReadID3Tags(string path) { Mp3File mp3File = new Mp3File(); string fileName = path.Substring(path.LastIndexOf("\\") + 1); string fileP ...Show All
barkingdog Role based security: IIS based remoting server doesn't hold my principal
Hi, I have a VB.Net Windows form based user authentication system. The form authenticates the user info against a server through Remoting that is hosted by IIS. The authentication process runs well all the time. Once the authentication is done, I set up my customized identity and principal and set the principal to the current thread on the server before returning the call back to the client. The thing that suprises me is that, when my client gets back to the server the next time (client gets back through a remoting reference to the same server object that did the authentication), the security principal of the current thread on the server has changed! It went back to Windows principal again, instead of my own principal I just set. ...Show All
Andrew Westgarth Dataset and winodws application
Hi all i am doing a windows application for which i have taken a new dataset file in to the solution and i opened it in the designer view and added tables to the dataset .What i observed is in the backend it's generating huge amount of code. And i also did in the other way like taking a normal class file and create a dataset and add as many tables as possible which i can finish it in less code compared to above. What i studied is taking dataset and adding the tables directly results in "2-Tier Architeciture" and writing each table manually in our own class file results in "3 -Tier Architecture". My doubt is which would be better Dataset file or manually writing tables in the class file. No, this ...Show All
vicarious SchemaImporterExtension - machine.config
Hi! I created the derived class like shown in the sample. Now I can't get the debugger to step into my class. My machine.config looks like this (in contrast to what the sample is assuming I guess): < configuration > < configSections > < sectionGroup name = " system.xml.serialization " type = " System.Xml.Serialization.Configuration.SerializationSectionGroup, System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 " > < section name = " schemaImporterExtensions " type = " System.Xml.Serialization.Configuration.SchemaImporterExtensionsSection, System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 " /> & ...Show All
QuantumMischief OledbConnection and DSN
Hi, anybody knows how to connect to Database using DSN with OledbConnection (something that can be done using OdbcConnection and OdbcConnectionStringBuilder) Or maybe one knows how to connect to multiple DBMS and Platform without the need of users to enter the specification of their current DBMS. I want my application to receive just one thing from user (like DSN) and do the rest like retrieving tables and views. I previously used OdbcConnection and it worked just fine, but i found problem when trying to retrieve the tables and views using this connection. Thanks a lot ................. I've tried to use "DSN=myDsn;Uid=username;Pwd=;", but unfo ...Show All
J Noble SqlBulkCopy - Recommended BatchSize's?
Hello, Is there any rule of thumb for deciding what to set the BatchSize when using SqlBulkCopy When inserting around 20,000 rows When inserting around 100,000 What about 500,000 Is there any guide that could point me towards any 'rule of thumb's Or is the only way to test with my specific data and with different BathSizes I have googled but could not come across any 'guide' such as this. Thanks, Drew A lot of factors can affect your scenarios. Basically, increasing the batch size can improve performance. But constructing the batch in client and handling the results in the server also have some overhead. So you don't want to set it to 0 (one batch). Usually batch size between 100 and ...Show All
StartingOverProgramming Problem passing typed DataTable as WebMethod parameter
Hi, I'm knocking up a proof of concept project and running into problems with datatables. Basically I have two webmethods one returns a typed datatable (my client binds this to a datagird and adds/updates records) the client then hits save on the bindingNavigator (all done using wizards). Within the bindingNavigatorSave event I call my second WebMethod which accepts the typed datatable as a parameter. The problem is, when the WebMethod gets the DataTable it has Count=0. I put a watch on the webmethod call in the client and the table has Count = 2. Here is another post which explains the problem much clearer. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=282125&SiteID=1 Can someone please help I am on the ...Show All
