I need to write a program that allows the user to input student's names (in textbox) and their studentID (using array) and searching (by name and id). the list of the student data should display in a gridview.
i am working in a project and what i want to do is to have a search drop down list and text box. Lets say i have a gridview with all my results from database. In gridview i can see Name, Surname, country, phone number. From the drop down list i want to select the column in which i want to make my search. For example, from 3 choices(name, surname or country) i will select country. Then i have to type a country name in text box and the search engine will make the search for the country column. For example if i will type "U.K" in text box as a result i want all the people(name,surname,country) WHERE COUNTRY = U.K.
I need to search a keyword put in a text box. In my case, I want to search records by the month name. I would want a command button that displays results according to the keyword typed in a text box. Now I tried two methods, one with a text box, one with a query. Both Do search, but the fields return empty.
Heres the code for my form where the datagrid is: vb.net Public Class Form6 Private Sub Pay_CalculatorBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Pay_CalculatorBindingNavigatorSaveItem.Click Me.Validate() [Code] .....
I want to display summaries of data entered, by criteria, like by department, by month, by year etc. How do I do that one? I have vb 2010 express.
I am learning about the search capability in an array. I wrote a code that stores three names (first & last) and I want to:
- Make the user select a number (from 1-3) by using a (combobox) - If the user select the proper number then a message will appear that the name is there. - If not then an error message will appear.
I did all I could by creating this but my main problem is in the (ButtonFind). I went through lots of tutorials and this is what I came up with and I hope that my code is correct.[code]
I have an array (Items) which holds lots of instances of a class (Item).Item has 2 properties, a Group and an ID.there may be more than Item in the array(Items) that have the same Group and ID properties.How do I "search"/get the first Item which matches a specified Group and/or ID
I am having trouble writing a loop that will check to see if a random number exists in an array.Let me Elaborate I have a function that returns a random (integer) number between a range called GetRandom()I want to execute GetRandom() and then check to see if MyArray() contains the new number, if it does not contain the number then I want to add it to the array, if it does contain the array then i need to run GetRandom() again until it doesn't contain the number.how to determine whether to throw the number out or add it to the array.
Write a program that requests a color as input in a text box and then determines whether or not the color is in the text file. The program should use the Boolean-valued Function procedure IsCrayola that returns the value True if the color in the text box is a Crayola color.
Public Class Form1 Dim colors() As String = IO.File.ReadAllLines("colors.txt") Dim IsCrayolaAnswer As Boolean = IsCrayola(colors)
i'm having problems creating a simple button for a programme which finds the largest word in an array and puts it into a textbox. I've done most of the coding (I hope) was wondering if somebody could help me actually with the code that finds the largest text in the array as I am struggling the most with that.
Private Sub btnLongName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLongName.Click Dim LongName As String Dim LengthOfLongestName As Integer
Say I have an array of doubles sorted from smallest to largest. What is the FASTEST way to find the closest value in the array that is LARGER/SMALLER than the search value if an identical value is not found.
Code: dim myArray() as double = {1.245, 2.45, 3, 4.556, 5.4434} 'LARGER AND SMALLER SEARCH for 3 should obviously return 3 because its in the array. 'LARGER SEARCH for 2.46 should return 3 because it is the closest LARGER value 'SMALLER SEARCH for 2.46 should return 2.45 because it is the closest SMALLER value
I certainly can do this on my own, but I am looking for the fastest way.
I need to search a Byte array for the existence of another Byte array. The first array is large, about 30,000 bytes and the second varies but is usually between 300 and 500 bytes. I need to know the start position of the second array inside the first. For example if these were the arrays:
I would need to know the start position is 3. Code: For x = 0 To UBound(Array1) If Array1(x) = Array2(0) And Array1(x + 1) = Array2(1) And Array1(x + 2) = Array2(2) Then ' Found it End If Next
And loop through finding it by brute force but array 2 will be a different size on each system so doing the above, although I could make it work, isn't practical. I could even do multiple if's like if I find the first byte then find the second, then find the third, and make it a little more bearable but still. Is there a simple way to find a array inside another array?
I'm trying to search an object array for a particular object and return the index. g always ends up being -1 even though I'm expecting it to be 0. What am I missing?
Private Sub btnX1_Click(sender As System.Object, e As System.EventArgs) Handles btnX1.Click Dim g As SByte = Array.IndexOf(buttons, sender) MsgBox("If worked: " & g, MsgBoxStyle.OkOnly, "Test") End Sub dim buttons() as object = {btnX1, btnX2, btnX3}
Basically, I'm trying to design a function that can get the index of an element from one object array and use that to grab an element from a different array at that same index.
I am working on a program that searches an array for the lowest score then displays it in the label. So far I have coded it in For Next and For Each Next loops, but now I have to do it for a Do Loop. I've gotten it to work if I have the For Next in the Do Loop, but I'm trying to not have the For Next loop in the Do Loop.[code..]
I have been trying to write code that asks the user for the size of an array , and then takes inputs from the array. They are characters A-E... Then I am to call a function that will count the frequency of A,B,C,D,E . Then it is supposed to send the information to a listbox. Eg. There are 2 A's,There are 0 B's, There are 5 C's..
I have the code for populating the array, but when it comes to searching it for the frequencies..This is what i have so far.. [code...]
I am working on arrays and I am currently having trouble with searching and finding arrays. In this example, the user should be able to enter a Name, and it will output that person's stats.
Here is the text file (note, I should be able to go to this text file, add a few more names and the code should still work, which is why I am using loops,arrays,text files instead of if and else statements),
Kobe,29,6,4 Allen Iverson,28,7,4 Jason Kidd,12,10,9
So if the user enters Jason Kidd in the text box, this will display in another text box:
Jason Kidd averaged 12 points, 10 assist, and 9 rebounds.
[Code]...
All right now is the searching part. I really do know how to search for what the user entered and display the statement in a text box. I kind of have an idea of how to just get the name, but for it to get the name and then all the data for that name puzzles me even more.-I tried using .contain, indexof and few others.
I know to display the information in the text box will be something like:
In the past, I have learned by reading three or four other people's coding and once I gained understanding of how it worked, I could easily write my coding. I've got I will say this is a school project, so I don't expect anyone to just throw coding at me. I'd like to actually learn this stuff! Also, I HAVE read my book (over and over) and also requested help from the instructor, but as I'd like to meet the deadline on this project, I'm having problems waiting on his availability or lack thereof.
I can't figure out the syntax for searching an array of stored words for a string matching an input string. I understand the pseudocode of it, but I'm tripping up over what variables I need to put where, and how they should be formatted. More than happy to provide more details should anyone request them.
I have an array of objects I get from a web service. The 1st element in that array is meant to be displayed in a asp.net literal control. The rest of the elements are meant to be bound to a gridview.
I have to set GridView.DataKeyNames(This is really a question about the syntax for a string array, in VB.Net.)I am discovering the PrimaryKey columns names from within a loop, ie:For Each fld As IEntityField In Me.llbDataSource.EntityCollection(0).PrimaryKeyFields'fld.Name ' this is where the column name is stored, so I have to get this into an array Next..[code]So, basically, how does one declare a string array (as required by GridView.DataKeyNames), and then populate the elements of the array from within a loop?
So I've been using some code to generate directories and such in a custom treeview, but am looking to expand upon this idea. While it's not using recursive functions, and only calls functions when expanding levels, I'm not quite sure how to put some of these together.find a way to just search through all folders on the PC. If the folder contains audio files, that folder is than added to an array (searching a folder for audio files and adding that folder to an array is done). It's just recursivly searching all folders on the PC.Here is the code I've been using for the treeview (I'm not sure if it can be adapted):
Public Function ListAllDrives() As String() Dim arDrives() As String arDrives = Directory.GetLogicalDrives()[code].....
How to show pop up menu from database in gridview on each gridview row items ?Example of this is : http:[url].....Move your cursor to Departure time and arrival time...a want this type of popup in gridview items....which fetch entries from database..
In my application,i have a gridview in which columns are created at runtime.Actually these columns are created when i am entering data in a database table.[code]where Column1,Column2,column3 may vary during runtime.i need to enter values to these columns during runtime.But i cant bind these columns because these are created during runtime.The first column "Description" will not change.It will remain constant.For each description, there will be values for each column.At last these data will be saved to the database.How to add columns in the gridview during runtime?
I am able to export a gridview to excel, my problem is that I cannot figure out how to remove the formatting from coming over from the girdview. Here is the code I am using to export the gridview: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click