|
Dispose gives a MANAGED object (any class you write) the opportunity to clean up and free any resources that it needs to before the object is detroyed. For some classes, this isn't necessary. For others, this is a necessity. For instance, creating a FileStream object opens an unmanaged file handle allocated by the system. If you didn't call the Dispose, or Close, method on the FileStream object, the object would eventually be destroyed, when it falls out of scope, and the underlying file handle orphaned, causing a resource leak. Eventually, you could consume thousands upon thousands of file handles, never releasing them back to the system (Windows) and eventually crashing it.
The very same thing can happen with COM object that you wrap with .NET classes. If your .NET class creates an instance of a COM object, it also has to release that instance, using ReleaseComObject, when it's done. Usually, this is done inside the Dispose method of your class.
DeepakSharma wrote:
Are they substitute of each
other?
Not just no, but HELL NO. Dispose and ReleaseComObject deal with entirely different objects and situations. They are by no means interchangable.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks a lot for your descriptionn. It really helped me a lot in understanding the concept.
Regards
Deeps
|
|
|
|
|
I need to create dbf file format with vb.net,please tell the way.
Thank for your help.
|
|
|
|
|
|
There are 10 different applications that use that file extension (as told by the FilExt database). Which one of those are you talking about?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I will use the dbf file with dbfrom for windows.
|
|
|
|
|
i wan to interface the sound card in pc with the visual basic 2005 express edition, is it work?And where can i find the sound library before i start programming? i search for long and can't find it in any website.
i wan use the visual basic 2005 express edition to do a digital signal processing project which related to memory pointer, it it work? Or other software is more suitable?thx for your help.
|
|
|
|
|
Sure it'll work. You just need the right SDK for what your doing. DSP is a really vague description though.
If you have a SoundBlaster, go to http://www.creative.com[^] and click the Developers link. You'll find the SDK there. If you don't have a SoundBlaster, go to the site for your sound cards manufacturer. I'm sure you'll find an SDK for your card.
Microsoft has DirectSound, part of DirectX. You can download the DirectX SDK from the DirextX Developer Center on MSDN, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Helllo
I am using a datagrid in a web application(.NET). When an user clicks the grid I want an menu to appear, (something like windows right click). I was thinking of creating the menu and all the functionallity in VB 6.0 ActiveX, and importing the ocx into the web app and using it there...
Will this work?
Is there an better way to solwe this problem?
Spaz
|
|
|
|
|
Spaz80 wrote:
Will this work?
Yeah. It's overkill and the browser will have to download and install your component.
Spaz80 wrote:
Is there an better way to solwe this problem?
JavaScript.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi guys... need serious help with this..
i was reading the source codes at
http://www.codeproject.com/vb/net/epsendmail.asp
and i know that to send emails, you need to have an SMTP server. However, where i'm studying there isn't an SMTP server available.
I was wondering, is it possible to use a server such as the QKSoft free SMTP servers? If so, what do i need to enter under the "SMTP Server --->" fields?
Secondly, this particular code enables the user to send emails using the command prompt. Unfortunately i need to do it on VB.net, so what modifications do i need to make to the codes to convert it into a VB.net program rather than a command prompt one?
Lastly, which email address can i use for the "from" field? i don't think i can use some web-based email such as hotmail or gmail, right? so what can i enter in this particular field? if i were to use something like an ISP email address, won't i need to log in using my username and password first?
Thanks so much for your help guys... this project's killing me!
|
|
|
|
|
This is the code for email in VB.Net
imports system.collections
imports system.componentmodel
imports system.data
imports system.drawing
imports system.web
imports system.web.sessionstate
imports system.web.ui
imports system.web.ui.webcontrols
imports system.web.ui.htmlcontrols
imports system.web.mail
imports system.configuration
Private Sub btnsend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsend.Click
Server.ScriptTimeout = 1000
Response.Flush()
Dim smtp As SmtpMail
smtp.SmtpServer = "localhost"
Dim mail As MailMessage
mail = New MailMessage
mail.To = txtto.Text
mail.From = txtfrom.Text
mail.Cc = txtcc.Text
mail.Bcc = txtbcc.Text
mail.Subject = txtsubject.Text
mail.Body = txtbody.Text
Try
smtp.Send(mail)
MsgBox("The Mail Has Been Send Successfully")
Catch ex As Exception
MsgBox("Error: " & ex.Message)
End Try
Response.Flush()
End Sub
|
|
|
|
|
imports system.web.sessionstate
imports system.web.ui
imports system.web.ui.webcontrols
imports system.web.ui.htmlcontrols
imports system.web.mail
from the above code given, these few import commands gave build errors. Also,
Server.ScriptTimeout = 1000
Response.Flush()
Dim smtp As SmtpMail
smtp.SmtpServer = "localhost
these few commands were undefined too... what can i do to rectify these errors?
thanks in advance!!
|
|
|
|
|
hi
Regarding vb.net project i've created tetxboxes ,a combobox and add,update,cancel button...i've bind combobox control with ShipNO field as DisplayMember....At vert first adding new records and now i click update or cancel its displaying first record not the current record ...help me out how to display Current ShipNO in cbobox along with Current records in textbox when i click update or cancel button...Thanks in advance
here is my code for cancel button
bmbShip.CancelCurrentEdit()
If bNewRow Then
bmbship.Position = cboShipNO.SelectedIndex
bNewRow = False
End If
cboShipNo.Focus()
|
|
|
|
|
Hi
on update click you once again call the load values of the current index so that it will bind to the previous submitted field
|
|
|
|
|
Hi all,
One of my applications on the intranet is giving the following error...
"System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ASP.createrequest_aspx.updateTable() in C:\web\capexrequest\createrequest.aspx:line 737"
The application was running fine until earlier today and suddenly this error..I have no clue what it is...
if it has something to do with connectivity then I am using executereader() and Connection.close().also, all my other applications pretty much similar rather exactly similar are working fine except this one...
Can some one help?
Thanks in advance
Aartee.
...HE is watching Us All!
|
|
|
|
|
Accordin to the error message, you're not getting a response from the SQL server within the default command timeout (30 seconds, I think!) This is usually because whatever SQL code your server is executing is taking forever to return anything.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thankyou Dave, yes I have resolved the issue..I had not closed the connection in pageload. actually, i open and close the connection in several places in my application.
your help is much appreciated, thankyou.
Aartee.
...HE is watching Us All!
|
|
|
|
|
That would explain it. If you don't close the connection, the number of connections being used on the SQL server increases until it hits the license limit. Then you next connection request will hang until a previous connection is closed, thereby causing the timeout.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello!!
I use VB.NET to connect AccessXP. It works fine when the database has no password. But when I try to set user name and password and then use VB.NET to connect it again, it fail to test connection and there is error report. The report says about workgroup file. What does it mean and how to solve this problem.
Thanks.
|
|
|
|
|
You need to specify the username and password in your connection string. What is the error ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I use OleDbDataAdapter control to connect the database. When rag this control to my form then "Data Adapter Configuration Wizard" will appear. I set provider to be "Microsoft Jet 4.0 OLE BD Provider". After that, when I select my database and test connection.
- If I use blank password or use wrong password, the error reports "Test connection failed because of an error in initializing provider. Not a valid password.".
- If I use correct password, it reports "Test connection failed because of an error in initializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user."
What should I do with workgroup information file????
|
|
|
|
|
Hello everyone,
Does someone/anyone have a ready code(or open source code) for a Page Hit Counter?(page hit tracker) to count no of hits on a page. I need to embed a page counter on my 'Intranet' applications.
Language : VB.Net
Also, does anyone know of a free downloadable 'search engine' for .NET applications that can be included onto the company intranet system? I did a lot of google for it...but didn't help me much.
Thanks a trillion in advance.Any and all help is much appreciated!
Aartee
...HE is watching Us All!
|
|
|
|
|
arty=me wrote:
Does someone/anyone have a ready code(or open source code) for a Page Hit Counter?(
No, but it's really, really easy. Where-ever you store the count, you just need to increment it every time the page is hit, and it's not a postback. It's up to you if you put it in a text file, or if you have a database already where you can put it.
arty=me wrote:
Also, does anyone know of a free downloadable 'search engine' for .NET applications that can be included onto the company intranet system?
If the intranet is not online, I don't know, but if you have a web site that is online, you can do links to google that search only your site. Given that google are rich, I assume that writing a search engine is not trivial.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have one digit I/O and one A/D card to build a control system. There have unmanaged drvier. Now I want to use VB .NET to call these VC++ DLLs. I read some articles from here and MSDN how to program. But I try it, can't work. Please help me!, thank James
|
|
|
|