|
Wow it worked fine. Thank you very much
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
thank you you Helped me a lot.
thanks man
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
Hi all,
I am thinking of how objects are deleted in Visual Basic 6.
I am now using ADO for DB operations and I am not sure if my program clears objects correctly.
I use the following code for creating a recordset
--------START------------
Dim RecSet as New ADODB.Recordset
'Execute query here
RecSet.Close
-------END----------------
That's it. I do not know how to proceed further with releasing the object. In Visual C++ I just
call the Release Method of the Recordset pointer and everything is fine. Does Visual Basic automatically clear the object for me?
Thank you!
modified 8-Mar-17 3:48am.
|
|
|
|
|
Hi,
The last step could be: RecSet = Nothing
Hope this helps
|
|
|
|
|
when coding in vb6 I always use the following to make sure all objects are cleared
dim recset as new adodb.recordset
...
recset.close
recset=nothing
|
|
|
|
|
Yes man it will help, they are right, set everything to nothing
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
Thank you guys, I will try it
modified 8-Mar-17 3:47am.
|
|
|
|
|
I am working on a system for varsity and in one of the forms I need to be able to send an automatic reminder via email a week before the date of an appointment.
Appointments are stored in a database.
How do I send this email after an appointment has been made?
Evan Saunders
|
|
|
|
|
Hi,
You can use the MailMessage and SmtpClient .NET classes.
e.g.
Dim to As String = "you@domain.com"
Dim from As String = "me@domain.com"
Dim subject As String = "Hi!"
Dim body As String = "This is a message from me "
Dim mm As MailMessage = New MailMessage(from, to, subject, body)
Dim oSmtp As SmtpClient = New SmtpClient("Smtp.mailserver.net", "username", "pwd")
client.Send(mm)
Hope this helps
|
|
|
|
|
Hi There
Thanks so much, you made it look so simple. I was kinda stressing out. I hope it works. Thanks again
|
|
|
|
|
hi everyone,
i know this is very simple question.
i want to split my string on the basis of seperator
my code is following
Dim path,str,seperat As String<br />
str="0\0\0\0and--->Caption1"<br />
seperat="and--->"<br />
Dim Title As String<br />
Dim ItemInfo() As String = str.split(seperat)<br />
path = ItemInfo(0)<br />
Title = ItemInfo(1)
now i want to path contains "0\0\0\0". here i get correct result using above code but in title i want to store "Caption1"(on basis of seperator) but it stores "nd--->Caption1".
can anybody told where i m wrong?
how can i solve this problem?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Change the separator if possible, otherwise first replace your separator string with a character separator and then perform spliting operation using ur new character separator.
You can use Replace function to replace strings or characters in a string with other strings or characters.
|
|
|
|
|
hi iprasad2007,
i already know this thing but i want to split my string on the basis of its substring not on any character. sorry,but this is not the answer of my question.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
The problem with this is that the split function expects a array of chars and when you give it a string it just uses the first char (in this case the "a"). I don't imidiatly know how you could solve this but I have a workaround:
Dim path, str, seperat As String
str = "0\0\0\0and--->Caption1"
seperat = "and--->"
Dim Title As String
str = str.Replace(seperat, "~")
Dim ItemInfo() As String = str.Split("~")
path = ItemInfo(0)
Title = ItemInfo(1)
basicly the same code just that I replace the seperat string with "~" before splitting. This way ther is only 1 char to split on (or string of 1 char) and it works perfectly
hope this helps
|
|
|
|
|
Im not sure if you want to use pure .Net code or not, but if you dont you can do this:
Dim path, str, seperat As String<br />
str = "0\0\0\0and--->Caption1"<br />
seperat = "and--->"<br />
Dim Title As String<br />
Dim ItemInfo() As String = Split(str, seperat)<br />
path = ItemInfo(0)<br />
Title = ItemInfo(1)
The piece of code in bold italic is the VB6 way of doing it using strings and as you can see can it be used in VB .Net once the Microsoft.VisualBacic Namespace is included
Hope this helps.
|
|
|
|
|
Thanks keith,
its work
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
I believe the function you are looking for is a tokenize function (split a string by a delimiter(separator))
EDIT: I tried to write one here for you but got confused, I will tommorow when I got more time.
EDIT AGAIN: Mine doesn't fit in memory.
-- modified at 3:12 Saturday 1st September, 2007
All of my programs are downloadable at fahadsadah.co.nr
|
|
|
|
|
Hi All
As my subject suggest i have a vb.net Application. Whilst its running does not allow my computer to logoff. I have tried this on two other machines to no avail. Any suggestions. ??
I didnt include code because I don't think its necessary .
Cheers
Dom
|
|
|
|
|
Windows would prefer all applications to end cleanly when it shuts down. It therefore waits until they do so. But after a while it should pop up a dialog asking if you want to "End Now" which forces the application to close.
The application is obviously not responding to the shutdown event. This could be because it is performing an extended operaration without responding to events.
Why type of application is this?
|
|
|
|
|
Hi Colin thats what I thought so something must be wrong.
Its a windows app.
Its starts off with a form starting at runtime named Hidden
here is the code that triggers at load
<br />
Private Sub Hidden_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
xSock.UDP_Listen(10080)<br />
AddHandler xSock.DataArrival, AddressOf UDPArrival<br />
End Sub<br />
in the above code it calls a class method as below
<br />
Public Shared Function UDP_Listen(ByVal Port As Integer) As Boolean<br />
Try<br />
UDP_Server_Port = Port<br />
UDP_Server = New UdpClient(Port)<br />
thdUdp = New Thread(AddressOf GetUDPData)<br />
thdUdp.Start()<br />
Catch e As Exception<br />
RaiseEvent Sock_Error(e.ToString)<br />
End Try<br />
<br />
End Function<br />
<br />
Private Sub UDPArrival(ByVal vData As String)<br />
TextBox1.Text = vData<br />
txtText.Text = vData<br />
xSock.UDP_Send("127.0.0.1", 10090, vData)<br />
End Sub<br />
so can you see how i can resolve this issue ?
THanks so far
|
|
|
|
|
you're problem is (I think) you start a new threat but never stop and close it so this thread still exists and on shutdown (of windows) windows does not know what to do with it (I think)
try the following (just a guess)
in the formclosing of you're main form put application.exit this should close all threads at once
or you could just close the thread when it has finished
hope this helps
|
|
|
|
|
yep gave it a try but no luck unfortunately
I have a sneeky feeling the form_closing is not firing when i try to exit or lof off..
surely someone knows why my crappy code is not working
thanks anyway TDDragon =)
|
|
|
|
|
Is there not an event on the application class that fires when Windows issues a shut down command? (It's been a while and I might be a bit rusty on that)
|
|
|
|
|
nothing i can see thats fairly obvious.
anyone else
thanks Colin anyway
|
|
|
|
|
It would appear your UI thread is blocked somewhere, but it's not obvious in the code you've posted. Single step through the execution of your server and watch the code run, line-by-line. If the debugger gets to a statement where it stops and doesn't execute the next line, you've found the block.
|
|
|
|