Searching Results In A Database
Apr 16, 2009
[Code]...
I need to happen is for whatever is typed in the txtStockBookID text box to be searched in the 'BookID' field in the database (dbStratagem) and for all relevant records to be produced in the datagrid (grdStockResult). The code used above has so far safely connected and displayed the entire table (dbStock) in the datagrid but I am not able to restrict the results to only criteria searched.
View 2 Replies
ADVERTISEMENT
Mar 30, 2009
I have a problem which I have tried to solve in several ways, and by searching the Internet for various terms, searching through books and Visual Basic instructional videos, but none have yielded the correct results. My goal is as follows:
1. Create a Database listing job names, job numbers, and a link to the file about the job.
2. Create a form with 2 text boxes, a search button, a box to display results, and a preview panel.
The two above steps have been completed. The following is where I get stuck
3. I want to search for either the job name, and/or the job number, have VB search through the database and return the results in the results box.
4. On clicking on one of the results in the result box, the preview panel will show a preview of the file.
Notes:
i) The files being linked top are Microsoft Excel files.
ii) The box I have used for the results currently is a listbox, though I've no idea if this is the correct choice for what I want to do.
iii) The database I created is an *.xml database created in Visual Basic. I am a fair beginner to VB, learning as I go, but I'm stumped as to how to achieve this so any pointers on how to achieve points 3 or 4
View 2 Replies
Nov 29, 2010
I have to write a program that allows a user to input DVD info such as DVD Name, Year produced, Running Time, and Rating. The user then clicks a menu item "New" to save that info to a file. Then the next time the user inputs new DVD info it has to append the new data to the same file. (I got this far and everything is working writing and appending data)Next the year has to be able to search by DVD Video name and it has to print the info in the text boxes on the form, if not found then a messagebox should say not found. When I use the sub procedure that I have created to search the record it always comes back as record not found although the record in in the file.
Option Strict On
Imports System.IO
Public Class Form1
'Class level variables
[code]....
View 1 Replies
Nov 25, 2011
I have been taking a class in Visual Basic and am currently working on my final project which I am having some trouble with. I am using Visual Basic 2010 express The project is to create an application that will store data in a text file, specifically, Last Name, First Name, Customer Number, Address, City, State, ZIP Code, Telephone Number, Account Balance, and Date of Last Payment. I have gotten everything done except the ability to search the file by Last Name or Customer Number. I have no idea how to go about this? I was thinking of ways to use indexof or Readline to be able to search the data, but I'm not familiar enough with the code to come up with a good solution. Below is a picture of how my form looks..As you can see, I'm currently using 2 separate forms to get the data from the user. Here is the code for Form1 which is the "Customer Accounts" form in the picture.
Imports System.IO
Public Class Form1
Public customerFile As StreamWriter ' Object variable
Public customerFile1 As StreamReader ' Object variable
Public strFile As String
[Code]...
There isn't enough room to post the code for my secondary form, but you get the idea. I would like to be able to enter a search term in the textbox on the bottom right of the form, and either search the data as its displayed in the listbox, or search the actual file? I was thinking that the results would be displayed in a messagebox?
View 3 Replies
Jan 19, 2011
im just starting to work with some database stuff, and ive got data binding done but im a little stuck with filtering. Ive got a test project, which has
-- listbox (bound to column 2/firstname)
-- Combo box (Has items added, with the same names as the items in colunm 3. so it has 'RPG' and 'Puzzle')
Now what im trying to do is when the item in the combobox is changed say to 'RPG' only items in the db which have 'RPG' in the surname column are displayed in the listbox. Been Google'ing and reading but all i can find is examples relating to a dataview and i cant get them to work/adapt to my situation.
View 2 Replies
May 1, 2009
is there anyway i can search for a particular row in all columns in a database and display them accordingly? like in a customer table, i have CustomerID, Name, Address is it possible to search for all the details of a customer?
View 4 Replies
May 1, 2009
is there anyway i can search for a particular row in all columns in a database and display them accordingly?
like in a customer table, i have CustomerID, Name, Address is it possible to search for all the details of a customer?
View 9 Replies
Oct 28, 2009
I am doing an assignment for class and it is searching an SQL Database file. On the GUI I have a text box and a button to search this database. It is presented on the form in DataGridView connecting to the file, and the file connection test succeeded, I am kinda so so on understanding what is going on with the connection between the file and VB 2008 but I am getting 4 errors: Warning1The designer cannot process the code at line 119: Me.PlayersBindingSource.DataSource = Me.BaseballDataSet
[code].....
View 1 Replies
Mar 11, 2010
Im trying to input a search box in my forms so that when I type in a customers name it will show there record. I've managed to do it in my transaction form, but not in any other standard forms. In my transaction form I've got this code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSearchSalesID.KeyPress
Dim dv As DataView = New DataView()
[code]......
View 1 Replies
Jun 20, 2011
On a image file (PDF), the OCR has recognised the picture and text. However on Visual Basics, how do you search for a text on this image file? The primary goal is to allow a text search (i.e POxxxxx) on all the image files (PDFs). The returns of the search will be the assciated image files where the text (i.e POxxxxx) is found on.
View 1 Replies
Apr 3, 2009
I am currently trying to develop a program, for personal use, that will monitor the lending of items of music equipments to friends and family etc. And, for my program, I have a requirement, which is the ability to search a relational database, for items loaned, through my program, based on criteria entered in a set of text boxes located upon the program's form. I have already set up the form, and have searched the Internet high and low, to no avail (probably didn't look hard enough).e,I would also like to make another request... if possible I would like to achieve this task with use of the 'LIKE' statement, so that I don't have to input the criteria in full, when I wish to search the database.
The database that I am using is a standard Microsoft Office Access database, saved in a '.mdf' format, and the database comprises of three tables; LoanTbl (which specifies the loan details), EquipTbl (which contains information about the equipment loaned) and a LinkTbl (which forms the relationship between these former two tables) - the reason for the LinkTbl, even though it may seem unnecessary, is because the data has undergone 'normalisation', so that it is stored in the most efficient way possible.
Also, whilst I am on the point of linking together my program and database, does anyone also possibly have any ideas as to ways in which to add data to this relational database; I do have coding for this, however, it only applies to a stand-alone table, whereas there are relationships between my tables.
View 11 Replies
Feb 8, 2012
I am in the process of creating a program that is linked to a database. I want to automatically generate a reference number that is not already present in this database, to do this i know i am going to need to search the database to check whether that number is already present or not. But I am unsure of the best way to go about this. I am using an access database and vb.net.
View 8 Replies
May 1, 2009
i am using visual basic 2008 with vb.net as language. i have created an application in which i am using oracle 9i sql database. the table is admissioninfo in which the columns are rollno,feespaid,dept,sem,sec. i want to know how i can search a record i.e, rollno from the database through my program and the program will show feespaid,dept,sem,sec in the textboxes.
View 1 Replies
May 30, 2011
I tried looking up Threads that would search through an access database, but I keep running into this:
Quote:
502 Bad Gateway
The server returned an invalid or incomplete response.Is there any threads that would help me? For example, in my program if I wanted to search for a certain customer I would enter their info in text box and it would search through my Access database. I have all ready added the data source and even added a section where they could add in somebody to the database. But I can't seem to get the search part down?
View 10 Replies
Oct 10, 2010
Searching Database using LINQ
View 1 Replies
Dec 29, 2009
I have two text boxes and want the users to be albe to serach through Access Database for a first or last name.but my search button is not working
Imports System.Data
Imports System.Data.OleDb
Private Sub frmEmployees_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
[code].....
View 7 Replies
Sep 14, 2010
I want to ask you a question about searching in access database I have an employee list and this list is consists of ID numbers and name. For ex:
[Code]...
View 6 Replies
Jul 14, 2011
I haven't programmed in over a year and I am trying to get this to work. I have a sample database containing 4 columns (First_Name, Last_Name, Emp_Num, and Image). I wanting to type my search criteria in a textbox and search the access database by first and last names. nce the record is found I am wanting to display the name and image for that person. I have already linked my database to my project
[Code]...
View 8 Replies
Feb 3, 2010
I`m developing an appication which works with a mssql server database.At this stage I don`t have a problem connectiong to a database, because it`s on my computer.But the release version will be installed on few computers, when after installation user will have to choose the correct database to use with the application. I know how to find a working instances of MS SQL server in LAN, but after choosing an instance how to choose the correct database?
1. How to show databases availabale in th instance?
2. How to separate database designed for my application from all other databases in chosen instance?
View 3 Replies
Jun 11, 2009
how to add and remove entries from a database and now I need to know how to search it. I'm going to be scanning a directory and subdirectories and adding all files found to the database. I need to check if the file has already been entered into the database before adding it.
I though it'd be simple and would just require looping though each entry and checking the item for each entry. I played around with a while loop a bit and ran into some problems. Like when the database is empty.
I don't want to half-ass some code that seems to work, since that'd probably be slow and inefficient.
Also what are the technical terms for a column and row in a database. I'd to use the proper terms in the future.
View 1 Replies
Sep 8, 2009
i want to search a record from sql database searching by first name so im using a function in the data layer but it is not working
Public Function searchCustomer(ByVal custFname As String) As DataTable
Dim tabletdata As New DataTable
Dim conn As New SqlConnection(con_string)
[code]....
View 1 Replies
Nov 22, 2009
I want to connect to a database Ive created using Microsoft Access 2007. Im using Visual Basic 2005. I also want to be able to perform basic tasks such as searching.
View 1 Replies
Mar 24, 2012
my project name is book bank management system i need to give my author's name,book name and number of book's needed in my front end according to tht i want to know whether my book is available or not if available means return the number of books in the database
i am using sql server 2005 as back end and visual studio 2008 as front end
View 2 Replies
Apr 28, 2011
I know how to search for one specific number from a single line in an access database using a query, but now I have to search through a whole database and display each instance. Ex) I search the number "1" in column "1" of the database and it has "2" instances. So now I have to take the corresponding data in the rows next to it in order to display them in the label.
search: "1", both results are ID = "1"
results:
dates amount
10/13/2009 $43.00
12/25/2009 $86.00
I know how to put the results for "1" line of a database into the .item field, but im confused on how to search multiple lines of a database and store multiple items. Heres what I have so far...
Private Sub btnShowPay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowPay.Click
Dim targetid As String
[Code]....
View 2 Replies
Mar 25, 2011
I have 1 textbox 1 button and a database (Access) i want to create a search box. obusely what ever i type on the textbox if i click the button then it will search the database... like displaying it to another textboxes. i have this code, but every time i click the button only the actual searched data is shown and you cant navigate it. so i still have to create another button for removing filter.
Me.TblMoviesCDBindingSource.Filter = "[Title] = '" & Me.searchTextbox.Text & " ' "
Another: what if i have a comb box inside my comb box are my fields on the database. and when i click, let say name on the combo box, the only data i can enter are datas on the textbox in the field name. you know what i mean ^_^ . like when you search on some websites. a combo box that have fields giving you options what to search...
View 1 Replies
Feb 3, 2011
I am trying to search a database to find a record. Here is my code.
Private Sub mnuFind_Click()
Dim strQuote As String
Dim strCriteria As String
Dim strText As String
txtWidth.Enabled = False
txtLength.Enabled = False
[Code] .....
The problem that I am having is when I run the code it returns nothing. I have even put in bad data and I don't even get a message Data not found.
View 4 Replies
Jun 11, 2011
Am working on a movie rental system in VB.NET, but there's a problem. I want a situation whereby the user will have the privilege to search for desired records by typing a search string, then hitting the search button. The results should be shown on a datagridview. Here's my code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim MovieName As String
[Code].....
View 2 Replies
Nov 16, 2010
is it possible to search and retrieve identical photos in a database using VB.NET platform
View 1 Replies
Dec 23, 2009
my program i abot searching in a database viewed by datagridview and i want to search within two columns i'm using this code to do so:
InstructorsBindingSource.Filter = "PhoneNumber = '" & Trim(ToolStripTextBox1.Text) & "' and instructors = '" & Trim(ToolStripTextBox2.Text) & "'"
but its not working
View 4 Replies
Feb 21, 2010
i want to search item in MS access database using the textbox and a single command button only is it
View 2 Replies