.net - ADOX Leaving File Handles Open?
Apr 27, 2011
I am experiencing a strange issue with a VB6 -> VB.Net conversion. There is a function that uses ADOX to look through the tables in a given database, and reset the seed values of any columns in said tables with the auto increment property set to true.I tracked the issue down to a call of "col.Properties("Autoincrement").Value". If this line of code is commented out, then the file handle properly terminates when I close both the ADO and the ADOX connections at the end of the function. If I leave that line in, the handle stays open despite the closing calls and forcing garbage collection.Here's how I am closing the objects:
System.Runtime.InteropServices.Marshal.ReleaseComObject(adoConn)
Dim connection As ADODB.Connection = cat.ActiveConnection
If Not connection Is Nothing Then
[code]....
View 1 Replies
ADVERTISEMENT
Jan 20, 2012
How do I get the list of open file handles by process id in C#?
I'm interested in digging down and getting the file names as well.
Looking for the programmatic equivalent of what process explorer does.
Most likely this will require interop.
View 1 Replies
Jan 11, 2010
I'm trying to find where this code might be leaving old connections open, and I found this code that might be the cullprit. It is in a function. I'm wondering if this connection would close, if an exception occured from within the USING statement?
[Code]...
View 3 Replies
Jun 18, 2012
get a listing of all current open windows, with their captions and have the option to close these windows via code.
View 22 Replies
Jul 31, 2009
I want to compress an ms access database using vb.net. If the database is open this fails. How can I close the database, compress it, then reopen the database using vb.net code to accomplish this. I've already successfully written the code for compression, but I can't find anything on closing the database while leaving ms access open.
View 2 Replies
Jan 29, 2010
I'm trying to use StreamWriter to write to a text file; it creates the file fine, but when I open it up, it's still empty. I marked the code below where the writing action takes place.
vb Public Sub BHorse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BHorse.Click
Dim oMarketsReq As New BFExchange.GetAllMarketsReq
Dim oMarketsResp As BFExchange.GetAllMarketsResp
Dim BFWrite As System.IO.StreamWriter
BFWrite = IO.File.CreateText("C:Datamarket.txt")
With oMarketsReq
[Code]...
View 5 Replies
Apr 19, 2011
I have searched far and wide and have not been able to find a solution to my problem.I have a typical situation where a process is gradually eating up memory. The process eventually throws an OutofMemory Exception. This problem has been dealt with in the past by just building a special machine that has greater memory.
This process bombs on only one of our clients which has around 450,000 records. We iterate through the collection of accounts and build a class object that is then passed into the xml serializer. This object has several properties and methods that would not all be populated at the same time. These objects are populated based on the information in each account record.
I've checked on the way we call the contructor for the XML Serializer and it is in the format that would store the xml assembly and not create new ones each time. So, I do not believe there is a memory leak due to the creation of the dynamic assemblies.How we call the serializer: Dim k1Serializer As New XmlSerializer(GetType(ClassObject))
My questions are:When serializing a large object, does the serializer look at every possible serializable object or just the ones that are populated by your object?
Could the serialization of this large class object be causing an issue?I noticed when we pass in the serialized object, it's not automatically written out to the file specified. It takes a few seconds to, I guess, serialize the object and then write it out. Could the fact that we are iterating over so many records, so quickly, that the serializer is not having enough time to write out to the file and then release the memory?
View 2 Replies
Jul 25, 2009
I'm trying to create a DB using ADOX and it works just fine, problem is ADOX.Catalog.Append(Table), throws an exception: "Parameter is incorrect" I'm using Visual Studio 2008 Express edition here is my code,this is where I set the fields I want to be added, the DatabaseField type is a structure I've created to make it easier for me to add fields to the DB
1
' Define the field list
Dim Fields As New List(Of DatabaseField)
Dim Field As DatabaseField
[code]....
View 5 Replies
Jan 15, 2009
I am trying to append a table to database using ADOX in .NET (as you probably surmised from the topic title) I get the following error:
Create Database Failure: System.Runtime.InteropServices.COMException (0x80040E3D): Type is invalid.
It says the Type is Invalid on the line where I try to append the objTable to the Catalog
And here is the code I am using:
CODE:
View 1 Replies
Sep 14, 2009
I am very new to VB.net express and I am getting confused as to what does what. I have to work with DBF files (clipper/ Dbase iii or iv) I have code to create a new DBF file with a reference to ADOX. The code example seems to work. I can open and display a dbf file (from a clipper application) using an oledb.connection This allows me to fill a dataset and bind to and display a grid view. I have yet to succeed in updating the source dbf file.
Does ADOX do anything for me beyond creating a new DBF file?The DBF file is unsorted and not otherwise indexed. For the data massaging and manipulation I may use a temporary sort but the data relations do not need that and the tables are not related.That being said, it appears that the data wizards or command builder will be of little use.
[Code]...
View 5 Replies
Sep 4, 2009
How do i use ADOX w/ MS Access database? for connecting to Access , querying the database, adding,deleting,updating,etc.. are there any sample code for all these?
View 2 Replies
Nov 28, 2011
I have an Access 2007 database with a column defined as AutoIncrement. I need to remove the definition while I programitically load data into the database and then re-add it when I'm done. I've unsuccessfully tried the following code, but get an error: "Exception from HRESULT: 0x800A0CC1" I'm using the following code to try to remove the attribute:
Dim cn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim objTable As New ADOX.Table()
Dim objField As New ADOX.Column
[code]....
View 3 Replies
Dec 15, 2009
I have written a simple module to access NTFS Alternate Data Streams (ADS), which looks like this:
Imports System.IO
Module Module_ADS ' Alternate Data Streams
Private Const GENERIC_ALL As Int32 = &H10000000
[code]....
View 2 Replies
Oct 22, 2009
I want to create a new MS Access database table using ADOX. On this page, is code in VB.NET, but obviously it's not working in C# (when I want to "convert" the code). I'll be grateful if someone converts it correctly.
View 2 Replies
May 8, 2009
We needed an inter-process reader/writer lock.We decided to use a file and lock the first byte using LockEx and UnlockEx. The class creates a file in the system temp folder when it is created. The file is created with readwrite access and share read|write|delete.We also specify DeleteOnClose so we don't leave loads of temp files laying around. Obviously AcquireReader and AcquireWriter call LockEx with appropriate flags and ReleaseLock calls UnlockEx.We have tested this class using a small application that you can run several instances of and it works perfectly. The application that uses it has a problem, which we have managed to re-produce in another small test app. In pseudo code it is
Create InterProcessReaderWriter
Dispose InterProcessReaderWriter without acquiring any locks
Launch a child process which takes a reader lock
The first time this runs, it works fine. If you attempt to run it again, while the child process from the first time is still holding the lock, we get an UnauthorisedAccessException when trying to open the file.This appears to be a permission issue, not a sharing violation but all the processes in this test case are running as the same user.
View 2 Replies
Dec 18, 2009
I have a line of code that is producing the error: Retrieving the com class factory for component with clsid failed error: 80040154 ADOX The line of code is:
Dim
ADOXTable As New ADOX.Table
This error only occurs on one computer.
View 3 Replies
Dec 1, 2011
I have already managed to get friendly urls working with my cms; however, what i want to know is: with asp.net 4.0 routes options, how do i get a root leaving routing? When user types in www.mysite.com/page_name, which is aboutus, it goes to the page cms.aspx but leaves the other routes intact:
[code]...
View 1 Replies
Oct 6, 2010
When a user leaves a TextBox on the form I execute a format and save to a variable. This is saved to a database by clicking on a ToolStrip button.
The problem occurs if the user moves the mouse directly from the TextBox to the Button. Neither the Leave event or the Lost Focus event is triggered, the variable is not created and, of course not saved.
If I put the code in the Save Button and the User moves to another control, the formatting(data type Double to currency format in the TextBox) that I want to show is not executed.
View 13 Replies
May 9, 2012
My
vb.net
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closing
[Code].....
How to stop form closing?
View 9 Replies
Jul 20, 2011
So I have a few variables in an array a I want to compare another variable to each of them, if it is the same do something, AND STOP THE FOR LOOP. else carry on the for loop. So...
for i = 0 to 4
if variable = a(i) then
do some stuff
[code]....
how do i end the for loop from within an if statement that is in the for loop
View 2 Replies
Mar 6, 2012
Why would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.No error messages are reported when the file is opened.
View 2 Replies
Feb 11, 2009
I would like to open the excel file after create the excel file. The creating file function is done, but the system unable to open the excel file. My coding as below:
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim misValue As Object = System.Reflection.Missing.Value
[code]....
View 1 Replies
Nov 18, 2009
how to use open file dialogs to open a file to a text box?
View 6 Replies
Apr 9, 2011
this is urgent. i have a form in which i need to give timedelay of 3 seconds before each line executes. But when i try system.threading.thread.sleep its freezing the UI and furthermore all delays are executing as one single delay. that is
[Code]...
View 5 Replies
Aug 24, 2011
I have a modal pop up that is supposed to upload documents. It does that just fine, except that it doesn't give them a title, therefore nothing shows up on my page since Title is how they show up in the list. What should I replace LinkTitle.Text with to get this to work?I am trying to fix this guys code because none of it worked right. I added a comment below that has new code in it that is parameterized. This is in ASP.net 4.0 VB using Microsoft SQL Server.[code]
View 1 Replies
Jan 7, 2009
I find that if I do me.close and then reopen the form with showDialog later, things are as they were before I closed it. If I use me.dispose and then later open the form again, its as if it was never opened before. Are these two both valid methods for leaving a form?
View 6 Replies
Aug 17, 2011
The simple line:
Enabled = False
Leaves the user no options to do anything with the program.What I want is to disable everything using the given line (or if anything else), but leave a Menustrip enabled.
View 3 Replies
Sep 12, 2011
I'm trying to update an old code that I don't have the source code for. In this code, the user enters an integer in a textbox as part of a form. Once they move to the next textbox a new form opens to input the number of files that the user chose (in the textbox).I have created all of the forms, but I can't figure out how to get the code to open the new form once the integer has been entered in the textbox and the cursor has moved to the next textbox. I would prefer this to happen automatically and not involve a button.
View 13 Replies
Aug 7, 2011
I've noticed that when you click on a web page in Windows Explorer, or open a file in general, and the default application to open it is internet explorer, ie opens and opens the file. However, when I tried this on my Web Browser it opened, but ignored the file and went on its usual routine. How can I get my Web Browser to open and open the file that was clicked on in explorer?
View 1 Replies
Apr 28, 2011
I saved a file with the extension .doc. I use the RichText to write and save the text. I did not set any encoding type when I saved it. When I tried to open the file in the Richtextbox again, I got all the formatting characters in the RTF file. How do I correct this? How do I open and re-open a .doc file in the Rich Text box control without the formatting showing up in the box with the document contents?
View 4 Replies