VS 2008 Looping Sending Loopy?

Apr 21, 2009

Have this Uni question; which after 20 minutes of frustration I'm sending it to the brain trust (you might be interested).Write a program that, when a button is pressed, checks the contents of a textbox. If the textbox does not contain a number, the program informs the user of this and does nothing more. Once a number has been entered, the program will do something trivial such as displaying double the number in a message box.Notice that this can be done without explicit looping,even though the user might repeatedly enter non-numbers. Because it is an event-driven program, each iteration is started when the user clicks the button. The looping is driven by the user, not by a looping statement.

View 5 Replies


ADVERTISEMENT

Sending SMS - Looping Through Numbers

May 27, 2011

i have an application that is sending smses. the phone numbers are in an excel file which i am reading. i am trying to loop through the numbers and send out an sms but i am only able to send out an sms to the first number and the others i cant. going into the dubugger mode i am able to see that the loop is working in terms of going to the next number but then after the first number the code for sending out the sms doesnt work...here is my code,

[Code]...

View 2 Replies

VS 2008 Looping In Datagridview?

Oct 15, 2011

Mine is a windows app. containing forms named BOM nd BOMSelected..There is datagridview in BOM which contains checkbox column.. When the user selects checkbox, the selected rows should be seen in the datagridview of other form, SelectedBom..

[Code]...

View 39 Replies

VS 2008 Looping Through An Object?

Dec 15, 2009

I have been using the following code for quite some time to list the property values of an object:

Dim instance As New Configuration
Dim propValue As Object
For Each pi As System.Reflection.PropertyInfo In instance.GetType.GetProperties()

[Code].....

Works great but we've gotten alot of properties at this point and could use them in alphabetical order.

View 3 Replies

VS 2008 Looping Through Checkboxes

Apr 20, 2009

looping through check boxes.. checkbox1, checkbox2, checkbox3...... Error in the code ocheck = "CheckBox" & Str(t) as "Run time errors may occur when converting 'string' to 'Microsoft.office.interop.word.checkbox'." Dim No_Checkboxes As Integer, ocheck As CheckBox

[Code]...

View 7 Replies

VS 2008 Looping With Textboxs

Sep 8, 2009

I would like to know how to loop with textboxs. For example. I would set the text to "Hello" And the loop will send this...

-"Hello1"
-"Hello2"
-"Hello3"

I have tried many looping techniques but they all used listboxs and even modifying them I could not get it to work correctly.

View 3 Replies

VS 2008 - Looping Structures For Class

Dec 14, 2009

I have this Visual Basic class I'm taking online. At this point in the section all I'm supposed to know about are Do, Do While, Do Until, Exit Do, Continue Do, and For Next loops. So try not to go off in a fancy super-coder direction. And everything is (preferably) made through Console Applications on VBE 2008

Problem 1:
Write a program that evaluates the factorials of the integers from 1 to 10 using an appropriate data type. (factorials are... factorial of 1 is 1, factorial of 5 is 120, or 1*2*3*4*5=120)

Problem 2:
Make a diamond - 1 asterisk at the top, 9 asterisks at it's widest - using only nested For...Next statements to print the asterisks AND spaces, minimizing use of output statements.

View 4 Replies

VS 2008 DataReader Error In Looping

Mar 29, 2009

[code]I am facing difficulty in coding when intRow loop for the 2nd round. Error message "There is already an open DataReader associated with this Command which must be closed " appear in the above red highlight vb.net code.

View 6 Replies

VS 2008 Looping For Files In Directory?

Jul 12, 2010

I have some code that should update my listbox with files in a directory i have this code put in a timer:

[Code]...

View 10 Replies

VS 2008 Looping Through All Rows In A Datagrid?

Jan 11, 2011

Im trying to loop through all rows in a datagrid and enter a calculation in the field in the next column (first column is already populated with appliance names). The code below works but only on the first row. Can someone be good enough to point out my error? For Each row As DataGridViewRow In DataGridView1.Rows

If DataGridView1.Rows(s).Cells(0).Value = "" Then
DataGridView1.Rows(s).Cells(1).Value = "0"
Else
DataGridView1.Rows(s).Cells(1).Value = dtDLopt.Compute("SUM(Measurement)", "Appliance = '" & DataGridView1.Rows(s).Cells(0).Value & "'")
End If
Next row

View 3 Replies

VS 2008 Looping Through All Webcam Sources

Jul 2, 2010

I'm using this code to get the preview window

Dim iHeight As Integer = picCapture.Height
Dim iWidth As Integer = picCapture.Width
'
' Open Preview window in picturebox

[Code]....

As you can see, I have 2 sources. Would it be possible to not show the preview window, but instead loop through all the sources?

That would be in a timer, so like each 10 seconds a pictures is made from each source.

View 1 Replies

VS 2008 Looping Through Controls On Win Form?

Feb 11, 2012

i have a winform and i have about 30 labels and 30 picture boxes on it. What i would like to do is fill each label and picturebox with a value and image from a backend database. I could have easily done this in vb6 using control struture , for eg.

for x = 1 to 30
picturebox(x).image = value from database
label(x).caption = value from database

[code]....

View 3 Replies

VS 2008 / Looping Through Textboxes, Outputting To String ?

Feb 21, 2010

I have a number of textboxes in my program, and a few other controls with text in them.I want to loop through a select number of textboxes (1-10 in this case, for testing), and output their combined data into a string.Here is what I created, with the help of someone on this forum earlier.[code].....

View 4 Replies

VS 2008 : Looping Regex Match Collection?

Jan 3, 2010

I have my regex setup, which works prefectly:

vb.net
Dim testStr As String = "<option value=""18621335"">graham23s</option>"
Dim rx As New Regex("<option value=""(d+)"">(.+?)</option>")

[code]....

When i put it into my own application i have done:

vb.net
Dim stringSource As New Regex("<optionvalue=""(d+)"">(.+?)</option>", RegexOptions.IgnoreCase Or RegexOptions.Singleline)
Dim stringMatches As MatchCollection = stringSource.Matches(stringCle

[code]....

what i am having trouble with is getting the values while in the foreach loop.

View 3 Replies

VS 2008 : Looping Through All Directory's On The Hard Drive?

Oct 6, 2010

i have this piece of

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strFileSize As String = ""
Dim di As New IO.DirectoryInfo("C:")

[code]....

and it works just fine. However, saying that, i need to find a way to loop through ALL the directory's on the "c" drive and not just the main folder.

View 5 Replies

VS 2008 Looping Through The Contents Of A ListView Control

Jul 3, 2011

I'd like to go through all the items of a ListView control in order to ... well execute some code. I suppose I have to use the "For i=1 to ..." statement , but I am not familiar at all with this control. As I said , I'd like to check all of the items (the elements in the first column) and for each of them that has "Yes" on the third column , I would like to run the rest of the code .

View 9 Replies

VS 2008 See If Checkboc Is Checked When Looping Through Controls?

Jul 29, 2010

I am looping through all controls on my form and for all checkboxes, I want to see if they are checked. I cannot get the Checked property when doing this. Am I doing something wrong?

[code]...

View 2 Replies

VS 2008 Set Looping And Progress Bars And Hotkeys?

Sep 12, 2009

Ive been trying to work with looping code and get messeges like this.

[Code]...

But that is not important this moment... How would I set a code too use the progress bar? So As it loops at a certain rate {Lets say 1000 (1 sec)} It would show the progress. Currently using it to 1 - 50. (Note: The rate is not important as I know how to set that) EDITEDITEDIT: Thanks for the info so far, But regarding my other thread about hotkeys that I marked "Resolved"

[Code]...

View 5 Replies

What Is The Most Efficient Method For Looping Through A SortedList In VB 2008

Oct 29, 2009

The code below shows me (I think) that the "for each" loop is about 10% faster than the "i to n" loop, but the "for each" loop creates 567k in new memory? Is this right? Which way is generally most efficient with regards to speed and memory usage? If you want to run this code in VB just add a button and 2 labels to a form.

[Code]...

View 1 Replies

VS 2008 Looping Through Combo Box TEXT - Regardless Of Datasource Impossible?

Jul 26, 2009

I was wondering how i can loop through a combo boxes items display item field - and return the value for each - i want this to be generic regardless of the combo boxes data source - or if the combo box has been populated with a string list / class etc

View 3 Replies

VS 2008 Looping Through Txt File To Grab Case Numbers?

Feb 18, 2011

I have code to automize the creation of medical record charts in a data tree structure. I need to loop through a basic .txt to get relevant current case numbers and automate their chart creation structure. hat's wrong here... Msgbox(s) is returning my file name - not the first line in the file.

HTML
Dim myRootpath As String = "\backupcenterPDF_Archives$MedRecords"
Dim myTemplatePath As String = "\rbase$EMRTemplates"

[code].....

View 5 Replies

Sending Email - Operation Timed Out / Not Sending Error

May 27, 2012

I am trying to Send an Email with an attachment (using Gmail) but I keep getting errors like "Operation Timed out" or Failure Sending Email". It was working earlier today but I found out that i needed to add Using statement because the email was having a file open that had to be deleted after it was sent but afterwards it doesn't work.

Here's what I have (Portion of it):
Private Sub SendMailOneAttachment(ByVal un As String, ByVal pass As String, Optional ByVal smtp As String = "smtp.gmail.com")
Using oAttach As Net.Mail.Attachment = New Net.Mail.Attachment((Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\" & My.Computer.Name & "_" & fName & " .zip"))
Dim client As SmtpClient = New SmtpClient(smtp)
[Code] .....

The ports are correct I believe, no firewall up on my PC...

View 1 Replies

Sending Files/Sending Images/Msg For P2P Chat?

Mar 4, 2010

Which is better for Sending Files/Sending Images/Msg for P2P Chat?

View 1 Replies

Sending SMS Using Vb 2008

Aug 29, 2011

I have done a lot of searching in this forum which regards to my topic and it turns out that i'm kinda confused.. considering that i don't have any experience when comes to ports and stuffs. So i made my own thread for me to be on the right track..

[Code]...

View 5 Replies

Sending An Email In VB 2008?

Mar 1, 2009

is there anyway to send an email in visual basic ? like i have a section where users of my app can send feedback to me is this possible?

View 3 Replies

Sending An Email With .NET 2008?

Mar 11, 2010

I have this code below and everytime I run it I get this error.

Private Sub SendEmail(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
Email.To.Add(Settings.txtTo.Text)
Email.From = New MailAddress(Settings.txtFrom.Text)
Email.Body = "Email Body"

[code]....

The error I get is: The parameter 'addresses' cannot be an empty string. Parameter name: addresses And it's pointing to the Email.To.Add() section.

View 3 Replies

Sending E-mail In .net/2008 VS?

Sep 21, 2009

I've been able to create and send an e-mail using System.net.mail. But it appears that the message isn't being sent until the application closes. This causes two major problems for me.1) When the user tries to send a second message, I get the following error: a generic error occurred in GDI+. I believe this is caused because I'm creating and sending a screen shot. If I take out the screen shot the error goes away. The screen shot is nice but not necessary. I can work around it, if I have to.

2) I am using the e-mail to provide notification that a process has been completed. The sender may continue to do other work while in the application -- including sending an e-mail to another recipient.

What do I need to do to get the e-mail to be sent before the application is closed?

View 5 Replies

VS 2008 : TCP Sending Files?

Apr 14, 2009

I've got a client/server communicating nicely using TCP to send text strings and to parse and act upon the messages at either end, but now I want to be able to send small files. I thought it would be as simple as reading the contents of the file into a buffer and sending that buffer as if it was a message but obviously not. When I retrieve the message at the client end I get "System.Byte[]" so its given me the variable type and not the actual contents of the array I thought I'd passed in!

My Sending code is this :

Public Sub SendFile(ByVal Filename As String)
Dim sw As IO.StreamWriter
Dim fs As IO.FileStream

[code]....

(NB I did search for this within the forum and found some examples but they just didn't fit very well with the framework of what I'm doing, such as creating a 2nd tcp channel to handle file transfers?

View 5 Replies

VS 2008 Aol Email Sending?

Nov 11, 2009

i have hit a hiccup in a program i have been working on, and i need to know how to send emails with aol, as apposed to something like gmail. I was wondering if anyone knows what the aol sms port and host are, and how one can use them to send emails. (does anyone know how to send emails with aol?)

View 3 Replies

VS 2008 Sending An E-Mail?

Dec 21, 2009

Is there a way to pickup the SMTP server address, Username and Password for their E-mail account so that an e-mail can be sent directly from the application without having to use their e-mail application.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved