VS 2008 Using Greater And Less Than Parameters In A For Loop Statement
Jun 21, 2010
I am having a few issues with a For loop statement, code below:
Dim y1 as integer = "12"
Dim y2 as integer = "24"
Dim y2a as integer
[Code]....
Problem i have is that it selects all records that have a value equal to or less than 24 rather than the records that have a value greater than 12 and equal or less than 24. This appears to be an error i am making in the use of greater and less than?
View 3 Replies
ADVERTISEMENT
Jun 8, 2009
y friend and I are re-learning Visual Basic, and we are stumped on this bit of code.
For intAsterisks As Integer = 0 To intLine - 1
lblAsterisks.Text = lblAsterisks.Text + "*"
Next
View 6 Replies
Jul 13, 2011
[Code]...
Q:how to get the sql statement after sqlcmd parsed the parameters ?
View 6 Replies
Jun 22, 2011
I need to pass four parameters to a SQL statement and i'm using the following code. It works fine for the first parameter but ignores the rest without erroring.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conz As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
[Code].....
View 3 Replies
Jun 6, 2012
how do i pass parameters to my Table1TableAdapter.FillBy statement?i've configured the commandtext but i can't work out how to pass in the parameters.
View 7 Replies
Apr 29, 2010
I have ran into a situation where it would be a lot faster to create a thread by the users demand. Basically, what I have is some kind of downloading program which grabs URLs from the clipboard into a DataGridView. Now when multiple URL's have been added, it becomes really inefficient since only one URL is being processed at a time.Now what I wanted to do is, create a thread for each URL. The parameter for each thread are the URLs which are stored as strings inside the DataGridView rows.[code]
View 3 Replies
Dec 8, 2011
I am trying to understand how a for each loop works and am having some trouble. I am trying to create a program that will query a sql database, pull back the information and store it. I currently having it writing to a text file, and would like to take the information (such as name) and compare it to another list where the name is equal. However I am not exactly sure how the for each statement really works. I have looked at numerous sources and it doesn't make since to me as you can probably see from what I have put in here.
HTML
Public Class Form1
Public Sub newarrest()
Dim strsports As New System.Collections.Generic.List(Of String)
Dim employeelastname As New System.Collections.Generic.List(Of String)
Dim cnPodaci1 As New SqlConnection
[Code] .....
View 2 Replies
Nov 18, 2009
I was wondering which of the two code samples would be more efficient (or is the difference between the two negligible)?[code]
View 4 Replies
May 26, 2009
I am a new with using datarowview
The problem here is how to loop in dataRowview using for statement
View 5 Replies
Jul 28, 2010
I'm practising printing, and doing fairly well - not as hard as I was thinking.
My question is: is it better/preferable to use a "while..." loop instead of an "If..then" statement when printing.
All my printing code is in various If statements (if PgNbr = 2, If PgNbr = 3 etc) but I notice in most of the examples and webpages I read that a lot of printing is done in a "while..." loop
View 4 Replies
Dec 7, 2011
For loop statement with .count method
View 1 Replies
Oct 2, 2009
If completedOrders.Count <> 0 Then
For i = 0 To completedOrders.Count - 1
SyncLock completedOrders
'Do some work, for example this:
Dim text As String = completedOrders(0).getCN & " " & completedOrders(0).getDeviceName & " "
End SyncLock
Next
End If
Is a synclock needed before the if statement or for loop? In other words. When you call methods like .length or .count is it necessary to synclock them or can another thread be writing to it at the same time. CompletedOrders is a generic list of a class.
View 7 Replies
Jun 27, 2012
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As New Staff
[Code]....
Basically I am trying to update each record with 2 random numbers each time the button was clicked,my problem now is, the system will update the record but the data was wrong. Example, by right all data should be different (randomly string) but for some row it was updated with same data but in randomly, something row1 row2 row3 has exactly same data for column 1 and 2 then row 3 has distinct data, second time, row1 row2 same data row3 ro4 with different data. It is in random sequence. When I add a MsgBox to do testing in the For loop the data was updated correctly with all different data.
View 2 Replies
Jan 29, 2010
i have 10 radio buttons that have yes/no values. These are options to one question, so need to in the database under 1 record. so - question1 yes, question 1 no, question1 yes and so on. i want to use a while loop or some other loop to take all these values and insert them or update them in the database for that particular question. i m new to programming. the db table is ID, question, Answer. so it will be 1 question1 yes, 2 question1 yes, 3 question1 no.
View 2 Replies
Mar 11, 2010
I would like to terminate a do until ....loop when future value is greater than 1000 without using a Exit or Continue statement.
Do Until inti > intMonths
decFutureValue = (decFutureValue + decMonthlyInvestment) * (1 + decMonthlyInterestRate)
If decFutureValue > 1000 Then
[code]....
View 4 Replies
Aug 12, 2010
I am currently teaching myself the caveman code of Visual Basic (VB.net). Apparently I fail at If-statements or something, because I cannot get this to work...
[Code]...
View 9 Replies
Jun 17, 2011
Is it possible to define my list of strings like in 'good old' VB60, to use only on ebyte of memory for each character? .NET always seems to store any string as unicode, which doubles the required memory. The case is that I have a huge list of strings, all of the same size. It is about 50.000.000 items, 12 characters each. You can imagine I am running out of memory in no time. I tried converting them to arrays-of-bytes but in that case I loose the possibility to perform a "LIKE" statement in a FOR-EACH loop to check for a specific item.
View 6 Replies
Jun 1, 2011
if I have the following vb code,
for i = 0 to dTable.Rows(i).Count -1
Dim sql As String = ""
Dim strConn As String = ConnString
[Code]....
View 10 Replies
May 11, 2009
[code] The problem in my case, this is not working with this code. All I need are random numbers outside the above boundaries.Please note when I remove 'Not' in 'Loop While' statement, the programme runs indefinitely!!
View 11 Replies
May 17, 2010
I am trying to create a program in vbfor this problem: "A TV set is purchased with a loan of $563 to be paid off with 5 monthly payments of $116. The interest rate is 1 percent month. Display a table giving the balance on the loan at the end of each month". It must have 1 button and a list box that displays successive balances, contains loops to balances, loop code includes output to the list box, List box displays 2 columns (one for month and one for amount owed) and 5 months are displayed and the amount owed for each. The Amount Owed should go down each month from month 1 to month 5 where month 5 will equal to $0.00
Here is my code so far but somehow the 1 percent interest i cannot get to add on each month so I am not getting the write answer.
Code:
Dim rate As Decimal
Dim loan As Double
Dim pay As Double
[CODE]...
I have attached a jpeg of what the end result should look like when code is being run.
View 3 Replies
Sep 29, 2010
I'm trying to create a "quiz" program in VB. The questions to be asked are placed inside text files and have the following format:
[code]...
> VB thinks that im trying to open a file named, what im trying to do is open a txt file which have a file name similar to the value of integer.
labelQuestion.text = variable.Readline().
View 4 Replies
Apr 19, 2010
I am having problem with the coding of this (endless loop) and formatting of summary boxes before tests are complete that should not happen. (the overall goals is to have a separate validation procedure that does not calculate or dat displays are not performed until after call function is complete and valid. The validation that takes place are that two boxes are filled in - one is text and the other is a numeric value. (using vb 2008)
[Code]...
View 10 Replies
Aug 11, 2009
I assigned an integer as 1, and looped my program using:[code]I can recieve the packets without looping, but once i loop, i receive nothing.
View 29 Replies
May 13, 2011
I'm writing a query to select all records that has any part of parameter. I have one table called Employees. Some people have name like this: John David Clark If the parameter is
[Code]....
I should be able to get result back as long as there's a match in the parameters. If I use Function Contains (q.FirstName & " " & q.LastName).Contains(employeeName), I will not get any result back if employeeName is "John Clark" Function Contains looks only for next words from left to right. It doesn't match a single word at a time. So that's why I used this in the Linq to SQL:
[Code]....
View 2 Replies
Aug 30, 2010
I am getting error [07002] the # binded parameters < the # of parameters makers, i checked both parameters were perfect even though i am getting this error here is my code
[Code]...
View 1 Replies
Mar 14, 2011
Makes the following statement about the code below:
**"The computer evaluates the loop condition in the Do...Loop statment to determine whether the loop instructions should be processed. In this case, the inputsales <> String.Empty condition compares the contenst of the input sales variable to the String.Empty value. As you know the String.Empty value represents a zero length, or empty, string if the inputsales variable is empty, the loop condition evaluates to True and the computer process the loop instructions. *If on the other hand the inputsales variable is not empty, the loop condition evaluates to false and the computer skips over the loop instructions.
Based on the code I think it is the opposite: ...that while the inputsales value is not empty it should evaluate to true and process the loop and if it is empty it should evaluate to false and skip the loop?
See below.
Option Explicit On
Option Strict On
Imports System.Globalization
[CODE]...
View 2 Replies
Sep 1, 2011
I am working on my program as I have created picturebox1 and splitter1 in my program. I am coding on the if statement as I am trying to compare on the value that if they are less than 184, then do something.
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
If Splitter1.Location <= New System.Drawing.Point(184, 0) Then
[Code]....
I know that I can't compare the value using with <= which I will only have to use = instead of <=, but i still want to compare with the value that if it less than 184, then do something.
View 5 Replies
Feb 14, 2011
How should I write not greater than 0 in VB.NET?
psuedocode:
if x is not greater than 0 then
do something
[code]......
View 4 Replies
Nov 5, 2011
im working on a project that is calculating the total population for given countries and its in the hundreds of thousands. And i need to output the population with the ,'s in the appropriate places.Ex. population 123456789 i need to output it in a listbox as 123,456,789 so im looking for a converter function or something built in that takes my value
[Code]...
View 3 Replies
Mar 5, 2009
How to compare Two Dates if it is Less Than or Greater Than?? I want to know the code that shows an msgbox "Date Past" if the date in a datepicker is already past.
View 6 Replies