Repeating The Same Value?
May 23, 2010Below code is working fine. but when i enter the next value it was showing the previous value only.
[code]...
Below code is working fine. but when i enter the next value it was showing the previous value only.
[code]...
So, I'm making my program which let's people auto-update other programs. Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "UpdateFiles"
Label1.Text = "Finding updates..."'To do: Find all files in the folder, and let em update one at a time. Write names of Plugins to label2.text ProgressBar1.Maximum = 10000
[Code]...
Before getting started, I'm new to VB and currently using Visual Basic 2010 Express. Just want to make sure I've got this in the right forum and my apologies if I'm not.[code]...
I have 16 cities (those would be my string variables, right?) that I want to appear on my 16 labels in random order without repeating when I click the button. So basically label 1 can be any of my 16 cities, label 2 then will be any of 15 left available cities, and so on and so on.
I have a datagridview that is being loaded from a dataset. This dataset is the result of a SQL Statement (which could be my problem). The MS Access Client table is the main table and contains 2 records, however, after loading the dataset, the row count is 3.
Below is the procedure where I load the dataset and then the DGV.
Public Function LoadClientDataSet()
Try
strSQL = "SELECT A.clientID, A.name, B.phone, B.zipCode, B.stateCD " & _
[Code]....
If say in my datatable i have one column called order number and one column called line. Whats the best way to keep repeating the order number into everyrow, whilst incrementing the line number until i add a new value in the order number column.
So it'd go like this..
Order#______Line
4568________1
4568________2
4981________1
I'm working on a Bingo game that generates a random letter and number.
Dim RandN As New Random()
Dim randnumber = RandN.Next(1, 30)
Dim RandL As New Random()
Dim randletter = RandL.Next(1, 5)
All that works, but I'd like it not to repeat a combination. Any tips on how to do that?
Also the random numbers tend to be repetitive and the random letter is never 5. I think the random number has been 30 before but I can't be sure. Is there a way to fix that or just a better way to do the random numbers?
there are 8 text boxes where user should put 8 answers, but when he type one answer in one text box it cant be found in some other text box.Basically when button is clicked there should be check for repeated answers.
View 3 RepliesI searched the forum and the web in general but did not find anything that answered my question.I am trying to create repeating sections (much like you can do in InfoPath development) in VB. For example, I would have a dozen textboxes in a section which the user would be able to fill out.
View 24 RepliesI have built a blog platform in VB.NET where the audience are very young, and for some reason like to express their commitment by repeating sequences of characters in their comments.
Examples:
Hi!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
LOLOLOLOLOLOLOLOLOLOLOLOLLOLOLOLOLOLOLOLOLOLOLOLOL
..and so on.
I don't want to filter this out completely, however, I would like to shorten it down to a maximum of 5 repeating characters or sequences in a row.I have no problem writing a function to handle a single repeating character. But what is the most effective way to filter out a repeating sequence as well?This is what I used earlier for the single repeating characters
Private Shared Function RemoveSequence(ByVal str As String) As String
Dim sb As New System.Text.StringBuilder
sb.Capacity = str.Length
[code]....
I am using dropdown list values Bound from data base my code
Public Function get_type() As String
'get type
If IsPostBack = False Then
[Code]......
I have a networkstream (using C#/VB.NET). while on reading values coming like this:
&% 68 kg K A&% 23 kg K A&% 174 kg K A &% 68 kg
&% 34 kg K A&% 2334 kg K A&% 68 kg K A &% 68 kg K A
&% 2348 kg K A&% 78 kg K A&% 28 kg K A&% 68 kg
The numerical(weight) value will be continuously varying.
Every time i am reading the starting of the stream differs. But the pattern remains the same. How to split that into '&% 78 kg K A' which represents one set.
How to extract the weight value from this stream using Regex or any other methods?
I need to count number of repeating and position where they repeat of all number in multidimensional array like this:
1 2 1
1 1 2
2 3 1
And result need to be:
Number 1- two times on position 1, one time on position 2, two times on position 3
Number 2- one time on position 1, two times on position 2, one times on position 3
Number 3- 0 on position 1, one time on position 2, 0 on position 3
I need to write a function to find the first non-repeating character in a string in VB.NET. Does the code below look ok?
Module Module2
Sub Main()
' Unit test
[code]....
i just want to know if there is a way to implement constraint for parameters with a repeating pattern. For that i meant something like this
ParamArray pattern as Integer()
if i need an integer, and any amount of the "pattern" (the pattern here is one integer). so basically the pattern accepts 1 integer and multiples of 1 integer, meaning 2 integers, 3 integers so is there a way to upgrade this so we can have this pattern:
Integer, Boolean
and any valid combinations for this pattern will include
Integer, Boolean, Integer, Boolean
Integer, Boolean, Integer, Boolean, Integer, Boolean
etc, etc
currently the only way i can think of is to wrap Integer and Boolean as 1 object and apply pattern 1, but i was searching for a better alternative?
I have an array that hold 6 random number, then this numbers are sorted from smallest to highest. My question is: How would I go about replacing any repeating numbers with a different random number. I.e. 1 3 7 2 2 9 is sorted into 1 2 2 3 7 9, but I would like to see one of the 2's replaces with a different number (that it is not currently in the array).
I have no code for this part - but the code for making the random number, storing them and sorting them works fine.
Basically I have 7 labels on a form that I randomize into numbers between 0 and 49. However some of the numbers repeat, like this 1,4,8,14,14,50,12. [Code]
View 2 RepliesI have a combobox that I am populating with the contents of a dataset (from an access database). The field that it is showing has lots of values that repeat. I want to remove the repeats of the data so that only unique records are shown in the combo box. I imagine this can be done with the SQL for the data adaptor? I tried: "SELECT type FROM products GROUP BY type" and "SELECT DISTINCT type FROM products" but both still showed the repeating records.
View 8 RepliesI am currently creating a vending machine program, designed to simulate a vending machine. However I have come across a rather large error, my stock is 50 at the begging. The person can go though the program and the appropiate amount of stock is taken away from the relavent object, however when I finish and want to go back to the start the last selection is still present.Therefore I have tried setting the variable as 0 when the form opens and when the program starts, but the last selection is still present.Does anyone know of a way to which I can reset this calculation without affecting my stock so I can then repeat my program cycle one or two times each time using the previous stock without reseting back to 50
View 10 RepliesOk im making a program that throws three dice at once. Several results end with a score but a few result in a no score. in the case of a no score (Example: the dice land on 4,1,6) i want the dice to be thrown again. If there's 3 no scores in a row then it counts as a loss.I have no clue how to get it to repeat after a no score or to limit i
Current code sample:
Dim oppscore As Integer
Randomize()
[code].....
Imports System.Diagnostics
Public Class Form1
Dim game1 As Boolean
[code]....
I'm trying to figure out the best way to approach this. I have a BackgroundWorker which is being used to make a socket connection on a timer.
[Code]...
edit: thinking about it. It would be good if I could somehow build a watchdog into it, so if the BackgroundWorker thread is found to be running for more than 2 seconds, it's terminated as this would indicate the thread has been held up by the tcp connection.
For every form I create, I do the following [code]...
What are my options for avoiding such repetitive actions?
Is there a "best-practice" for such a scenario?
Note: the reason I'm doing changes 1-3 is that the application's GUI is in Hebrew, and the application isn't required to support further localization or internationalization.
I am writing a matching program, and need 24 objects to randomly appear, each twice, across 48 spaces. I figured the best way for me to do this would be to assign the positions a number 1 through 48. but the problem is I can't find a way to generate a random number sequence in visual basic 9 .netI found many examples in visual basic .net but the conversion doesn't work. If not some code, many some example programs that either use a random number sequence or randomly sets the position of objects.
View 1 RepliesThe user can enter text into the system but I want to detect if the previous string entered is the same as the next string entered. if it is an error message or something will appear.
View 4 RepliesI have an Infopath form that retrieves data from a datasource, then populates a repeating table with a dynamic number of rows depending on employid. Once the data is populated, a "user" can enter numbers, times, etc. That part works fine. Now, what I would like to do is submit the data to a sql database. I just can't figure out how to navigate through each record of the repeating table. I have tried the following code, but have been unsuccessful. I can not get the XpathNodeIterator to work on the secondary datasource.
Dim domNav As XPathNavigator = Me.DataSources("getEmpHourlyPaycodes").CreateNavigator()
Dim rows As XPathNodeIterator = domNav.Select("/my:myFields/my:ReturnedData")
While rows.MoveNext()
Dim field1 As String = rows.Current.SelectSingleNode( _
"my:descriptn", NamespaceManager).Value
' Submit code will go here.
End While
I have a program with two forms, one that handles the applications controls, and the other with the functions that open a file (csv), open a database, and query the database. The controls on the first form are a list box, three labels (to display parsed csv information), and three buttons (clear database, load database from csv, and load listbox).
The clear database and load database buttons (events) seem to function correctly.On the other hand, the load list box event doesn't function 100% the way I'd want. [And, I can't test the selected index event yet]
The code for the load list box event is:
Code:
Dim db As New DBUpdt 'second form
b.openConnection("weather.mdb") 'open database connection
db.query("SELECT * FROM stations") 'query database
Do While db.moreRecords
[Code]...
I want to make all possible combination of each and every words from a entered string (without repeating). I found on net but can't get code for word combination instead I got character combination.
View 8 RepliesI'm a newbie in asp.net. When using FormView, there is a big amount of code in ItemTemplate, EditItemTemplate and InsertItemTemplate which is almost identical.
[Code]...
ListView allows the use of LayoutTemplate - but I didn't see any examples that insert this kind of code in LayoutTemplate. And inserting this code in LayoutTemplate would result in an error.DetailView allows to produce code automatically but I'd like to use a specific design (for ex. using "fieldset" that encompasses some fields).
Am a student n am currently working on my final year poject n am new to vb.net. My project is for a clearing n forwarding agency. i need to prepare a bill for the duty to be paid. in a particular invoice, there may be single item r multiple item. for each item i've to calculate some values n display it on excel. i've made my excel book to be a template with all the things i should display. n the calculated values'll be displayed in corresponding cells which'll be retrived from database. if its single item its all good n i can prepare the bill easily but for multiple items i've to repeat certain cells from the template. i dunno hw to do it. am attaching my excel file with tis.i want to repeat the cells A24 to J35 'N' number of times with th
Dim xla As Excel.Application
Dim xlwb As Excel.Workbook
Dim xlws As Excel.Worksheet
[code].....
I am coding a Student Management System using VB.NET and Access DOn the Form for Teacher Bio-Data, I want to use a table in which I can place Teacher Qualifications in a tabular format. In other words, say, the teacher had Primary, Secondary and Tertiary education. I want to put a header as Qualifications, Year and Grades. Is there any such tool in Visual Studio that I can use?
View 9 Replies