Database - Does This Function Release Resources Properly
Sep 23, 2010
I'm trying to make sure that I don't leave any loose ends open in my application and am concerned about a few but might get my answer from this one. I've "overriden" some functions so that way I can try and keep all the resources as clean and free as possible. So in this instance, I have a function called ExecuteReader which returns a DbDataReader as normal, but all I had to pass to it was a SQL string rather than recreating a DbCommand every time. I want to make sure that even though I'm unable to call dbCommand.Dispose() that it is actually doing so.
[code...]
In here, I set the _dbReader to what I'd get from the function and eventually I close the _dbReader. I do not close the connection as I don't open it each time I make a query. This is a SQLite database that only one user will be using at a time (small application with very very very little likeliness it will grow) so I didn't think it necessary to close and open the connection all the time. Maybe I'm wrong, not sure. Using it this way though, it is potentially ok for cleaning resources?
View 2 Replies
ADVERTISEMENT
Oct 5, 2010
I'm working with datatable with a big amount of data. On the way of converting the data to the final form I need I would like to get rid of the datatables that I don't need anymore. This is mainly because I have three really big datatable that pumps up the programs memory usage close to the limit. (Out of Memory Exception).So is there any way for releasing this memory used by the datatable that I don't need anymore?
View 9 Replies
Apr 27, 2009
I have a little problem with my program, Boot Animation Previewer.Firstly, it loads the .zip file and extracts the boot animation in a folder called Temp. If there are existing files in the Temp folder it deletes them. But, once the boot animation is previewed, you can't select another boot animation, until you restart the application, because it gives an error, saying that the program can't delete the images, because the process is using them
View 2 Replies
Aug 1, 2011
Firstly, it loads the .zip file and extracts the boot animation in a folder called Temp. If there are existing files in the Temp folder it deletes them. But, once the boot animation is previewed, you can't select another boot animation, until you restart the application, because it gives an error, saying that the program can't delete the images, because the process is using them.
My question is: how to stop using the images? I've tried to dispose the form that loads the .zip file, but with no success.
View 12 Replies
May 2, 2012
I have created a program that opens and closes web browser controls many times. I need a way to release as much memory as I can but it's difficult as even calling the dispose method doesn't seem to work. Do I need to do anything else to the web browser
View 5 Replies
Dec 20, 2010
I have created a program that opens and closes web browser controls many times. I need a way to release as much memory as I can but it's difficult as even calling the dispose method doesn't seem to work. Do I need to do anything else to the web browser control to fully release it's resources?
View 4 Replies
Jul 27, 2009
I set a range with a function like this:
Code:
Public Function GetRange(ByVal strCellRange As String) As Microsoft.Office.Interop.Excel.Range
Try
[Code]....
View 1 Replies
Sep 17, 2011
I have a function which return the Dataset and my question is that, is dataset memory release automatic when function work finished if not please suggest me how i release memory in below sample question?
public function givemedataset()
dim keepme as new dataset
'grabbing record into dataset
return keepme
end function
Private Sub forumbrowsebtn_Click
dim getme as dataset=givemedataset
end sub
View 1 Replies
Jun 14, 2011
I'm using fileopen() function to open the file, after doing all the works I'm using fileclose() to close the file. But when I access the file again it returns already the file is opened by another process.
Sample:
Dim intFile As Integer = FreeFile()
FileOpen(intFile, mstrFilename, OpenMode.Binary, OpenAccess.Read, OpenShare.LockWrite)
FileClose(intFile)
View 1 Replies
Nov 9, 2011
I'm currently working on a school project and I have stumbled upon various problems. I'm supposed to write a software tool based on a mathematical model.
In total, the model has 12 parameters and 2 constants used in it, so I figured it would be a good idea to store the parameters in 2 separate arrays - one containing 6 parameters which have to be entered by the user and another one with another 6 parameters which should only be changed in a settings kind of window for tweaking (they are set to default values provided by the model).[code]...
View 4 Replies
Feb 11, 2010
have an xml file like this.
<?xml version ="1.0" encoding ="utf-8"?>
<menu>
<menuNode title="Register" value="true">
[Code]....
View 2 Replies
Nov 21, 2010
I'm having trouble getting an Applications.DoEvents event to function properly. VB keeps telling me I dont have a valid argument. Can anyone look at this and explain how I would complete the expressiojn for Application.DoEvents.
[Code]...
View 4 Replies
Feb 15, 2012
i'm working on a project that is trying to calculate the discount on three different kind of packages, each worth different prices.
what we are given is
package A= $99
package B= $199
[code].....
View 6 Replies
Jan 8, 2010
I have developed a small window application, having lot of insert and select scripts. It runs fine for 3 times but when i run it 4th time it gives me Error "Out Of Memory Exception". I observed that in my task manager Sqlserver.exe process occupies memory around 167000K. Then I killed it. and again run the code, this time it occupy 12000K memory. Again I run it...the memory increases and stops at 87125K. All It means i the C#.net objets are not disposed well.
I have tried for
GC.GetTotalMemory()
But failed? How can I release objects?
View 8 Replies
Jun 11, 2012
I have a windows desktop app I'd like to release that would access data from a database on the web. Never done this before, so not sure what's needed either on the client side or the server side.
View 1 Replies
May 13, 2011
Does anybody know the code to refresh and reload desktop icons, you know how after installations of programs it sometimes refreshes the desktop? That is exactly what I need and what I am looking for. Someone please help me out here because I tried searching on google and could not find any proper code.
View 5 Replies
Jun 8, 2011
I have some ActiveX that was written for VB6. They all seem to return Variant types. Ex.
[Code]....
In this case the GetPosition control is returning a robot axis position. It looks to me like the values coming back from the function is not getting converted to object type properly.
View 2 Replies
Dec 22, 2009
I am using ASP.NET 2.0 with SQL Server 2005.
My page have a text box where TextMode="MultiLine"......see below
Now when I save this text in my database of course it does not save it with any HTML tags, and thus when i read that value from the database it comes back as 1 line such as....
But I want it to be dispayed just like the user typed it. Is there no out of box control that will do this for me rather than me using Ajax or jQuery?
View 3 Replies
Aug 23, 2009
I am building a windows program that I need to link to add and pull information from an access 2007 database. I really so not want to use SQL if at all possible.
View 3 Replies
Jan 1, 2012
I am looping thorugh a datatable and and printing each row to the console and I keep on getting a dbnull error. I inserted an if statement in my loop to try and catch it, but I can't seem to get it to work.
[Code]...
View 3 Replies
Jun 22, 2010
I am looking for a code snippet which opens a image, creates a clone of this bitmap in memory disposes this opened image so that all handles are closed.
Usually we can open a bitmap using this[code...]
the following code however keeps the Image File locked until the application is running, any suggestions how to dispose it properly. (So that no handle is left open )
Things i already tried: use dispose method of bitmap <= doesnt work (need to write implementation)
Using Block also doesnt work.
View 2 Replies
Jun 28, 2010
We use Global Resources like Resources.ResourceFile.Resourceproperty and this works like a charm. The problem is that we have got some statusses in a database. We have to make a column for each language but we don't want to do that. Are there any other solutions to this problem, as you know? We don't like any third party controls.
View 3 Replies
Jul 23, 2009
I have searched high and low and can only find some very bad documentation on how to properly save the data from a rich text editor to a SQL Server database. I am not working with personal profiles, I just want to understand how it is properly done, including how to properly escape said data.
View 2 Replies
Jul 30, 2010
how to properly connect to a MySQL database check if a login is valid.Basically i want someone to write me an example of how i connect to a MySQL database, check if username is correct, check if password is correct. If username and password is correct- it should return True as of boolean dim.
View 2 Replies
Aug 19, 2010
how to properly connect to a MySQL database check if a login is valid.Basically i want someone to write me an example of how i connect to a MySQL database, check if username is correct, check if password is correct. If username and password is correct- it should return True as of boolean dim.Otherwise it should return false.
View 1 Replies
Mar 25, 2009
I was currently looking at on old application that I am maintianing and it uses a mixture of retrieving Application config settings from both the App.config and application config table in the DB.In the new software I am working (a port of the old application) I have a list of email addresses that are static and rarely change, what would be the best mechanism for retrieving these. Currently I am using resource strings so that using them is a simple My.Resources., but what are the benefits/drawbacks of storing the information either in the App.Config or a database table.
View 3 Replies
Feb 28, 2009
i'm unable to debug my project that i made. i save it and everything, but it just won't playit says Warning 1 Could not find type 'WindowsApplication1.My.Resources.Resources, Time table'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built. C:SchoolIPTTime table, using 2 loopsTime table, using 2 loopsForm1.Designer.vb 123 0 now when i open it up and try to debug it , it comes up with an error, i even try referencing it but it does nothing ,
View 2 Replies
Jun 22, 2010
error: the item "objdebugassociateassist.frmdbsetup.resources" was specified more than once in the "resourceS" parameter. duplicate items are not support by the "resources" parameter.
View 1 Replies
Jun 16, 2009
In the software I am developing for my A-level computing coursework I want to add a function to export the database (to backup, use in other computers, etc) and later on a function to import databases (that I had previously exported using this function). At the moment I have a SaveFileDialog, and I have filtered .mdb files only (as this is the type of files supported by my application). But How do I select what is going to be saved? (How do I point to the .mdb file that is located in the program's directory?)
View 12 Replies
Jan 27, 2010
This is my function:
Public Function DBConnection(ByVal path As String)
' This function makes the database connection and returns the object
' to reference it.
[code]....
As you can see, I want to initialize a database connection and return it so I can use it in my forms. This function is in a module and my variables are as follows:
Public cn As OleDbConnection
Public cmd As OleDbCommand
Public dr As OleDbDataReader
But I'm not sure how I can use this in my forms, do I just call the function DBConnection and then proceed with my SQL statements? Also, I need some opinions. My application relies on a MS Access database. Is it better to initialize the connection on Form_Load and then close the connection when the user closes the program, or open and close the connections as the queries are run? I'm planning to use some database queries on multiple forms hence the reason I was putting it into a module, but I'm not 100% on how I should proceed with this.
View 2 Replies