How to: perform a quick search against database table

  Рет қаралды 106,322

mkaatr

mkaatr

Күн бұрын

Пікірлер: 63
@MrDjmclaughlin
@MrDjmclaughlin 13 жыл бұрын
Man, this was EXACTLY what I needed! Thanks for taking the time to put these videos together! Keep up the great work!
@mkaatr
@mkaatr 13 жыл бұрын
@deathpedal Hi there... You could create a query adapter that execute the following sql "delete from mytable" replacing mytable with your table name. Since there is no where part then the sql will remove all records in that table. If you want to clear the whole DB then you need to execute this kind of SQL on every table, and also you need to take into consideration the Foreign key constraints while doing that.
@sathishraju3234
@sathishraju3234 7 жыл бұрын
Hi, Direct name search without typing %. Button1_Click Time on Video 5:15 Copy and paste the below code or check the code; I have added 2 % symbols after like. PersonDataGridView.DataSource = Me.TestDBDataSet .Person.Select("personname like '%" & TextBox1.Text & "%'") Once done, run and check, you will be able to search names without percentage symbol. I'm not a programmer but luckily it worked for me. Thought it might help others.
@Dranzer151
@Dranzer151 12 жыл бұрын
The simplest way must be to change the code for the button. Just automatically set a % after and/or before the text. That might solve your question. But if you want to search for matching results without "%" just do like Paul said: .Select("ColumnName LIKE '%" + TxtLike.Text + "%'")
@notta3d
@notta3d 14 жыл бұрын
Thanks for the video. Looking forward to the UPDATE, INSERT and DELETE videos.
@Dranzer151
@Dranzer151 12 жыл бұрын
You need to have a "If" first of all. After that you need a "Then". In the end you'll need "End If". In the middle you can use "Else" or "Elseif". If it doesn't work make sure it is "Connected" to the right If.
@mkaatr
@mkaatr 12 жыл бұрын
I haven't worked in VB6 for a very long time. So I am afraid I can't be of much help. However you could create a SQL statement that filters data based on a specific parameters. This should work in VB6.
@sudani1969
@sudani1969 13 жыл бұрын
Mkaatr you ARE THE MAN followed your instruction and added row count and it worked Dim dt As attendanceDataSetTableAdapters.DataTable1TableAdapter dt = New attendanceDataSetTableAdapters.DataTable1TableAdapter() dt.Fill(AttendanceDataSet.DataTable1) , Dim rCf() As attendanceDataSet.DataTable1Row rCf = AttendanceDataSet.DataTable1.Select("username = '" & txtUser.Text & "' AND `date`= '" & Now.Date & "'") If rCf.Count > 0 Then MsgBox("Stop") Else
@Kvn12x
@Kvn12x 10 жыл бұрын
Thanks for the video, really helpful, but I have a problem, everything works fine when I use the search button but when I'm done searching, my data grid appears blank. Could you help me?
@fatmabenrejeb3979
@fatmabenrejeb3979 9 жыл бұрын
thank you for your video , and if i want to use a combobox instead of textbox and want that items will be PersonID, StateID, PersonName and not their values , what must i do?
@sudani1969
@sudani1969 13 жыл бұрын
hi mkaatr i watched your video it help me alot...but could you tell me if i have to different table i want to show only 2 columns from on table and other column from othe would i be able to displayed in 1 datagrid.. thanks evry one
@mkaatr
@mkaatr 13 жыл бұрын
@landy1727 Hi there... could you give more details on how did you make the search?
@riponkamal1
@riponkamal1 13 жыл бұрын
Hello sir, thanks to you for excellent tutorial. Could you please help to search between two parameters. for example: there are five different dates in a date column. i would like to search dates between one to three and it shows on Data grid. Please please please please help me.
@shaolin113
@shaolin113 14 жыл бұрын
Excellent tutorials....thank you :)
@wanfarok
@wanfarok 10 жыл бұрын
this is great man! i'm really grateful
@samalex4548
@samalex4548 10 жыл бұрын
Great job. this was really helpful thanks a ton
@mkaatr
@mkaatr 13 жыл бұрын
@loveemaw Hi there... Sorry for the late response, I was not very well last week. Could you give me more detail about the problem here? Are you getting a single row as a result? are you trying to cancel the search? Could you explain more? yours
@mkaatr
@mkaatr 13 жыл бұрын
@deathpedal Check 8:03 , you just change the search column to PersonID
@mkaatr
@mkaatr 13 жыл бұрын
@Kyuoera Hi there... what do you mean by "print the database"? could you clarify please? yours
@mkaatr
@mkaatr 13 жыл бұрын
@loveemaw I should be the one thanking you since I did not know about Filter. :)
@matyg.c.8464
@matyg.c.8464 11 жыл бұрын
hi could you please show how to add picture in your database which can be visible in data grid view during the search??
@fissehamalele4574
@fissehamalele4574 11 жыл бұрын
That is great tutorial.but i need to ask one thing.I want to search a specific items from the table.how can i search any data by some characters.for example,names starting f,fi,fiss,fisse,fissseh,fisseha. and so on.thanks a lot for your cooperation in advance!
@AmaruAria
@AmaruAria 11 жыл бұрын
can we do this during text change event? i mean is it the same thing?
@mkaatr
@mkaatr 13 жыл бұрын
@Kyuoera Hi there... To perform printing of values that you read from the db, usually you need to use some kind of reporting solutions. You could write your own code to work with the printer, but it requires some work. The issue is not the database here. It is how you format your output to the printer. I will try to record a video tutorial about how to work with a printer when I get some free time. yours
@jesferborce9347
@jesferborce9347 5 жыл бұрын
Can i have a code if i want to search the whole datagrid?pls?
@NazriMazlan
@NazriMazlan 10 жыл бұрын
Hello sir, how to perform search in UNION query?
@edwinedwine9013
@edwinedwine9013 10 жыл бұрын
helo great work been looking for this lines of code..
@utkarsh12
@utkarsh12 12 жыл бұрын
hi! is there anyway to search without the %. if i want to search names starting with A, can i search A instead of A%?? Thanks!
@mkaatr
@mkaatr 13 жыл бұрын
@sudani1969 Hi there... You have most of your work done already. All you need to do is create a table adapter, the will join the two tables, and create a new Fill method that uses parameters - username and password for example. Next you run the query, and get the result, and you could just check the field in the item array: if (MyTable.Rows(0).ItemArray(3)=Now.Date) then the line above illustrates the idea i did not check its syntax. If you still have problem with this let me know. yours
@FlakronSaidi
@FlakronSaidi 13 жыл бұрын
@deathpedal I need it too, if you find the answer, please tell me Thank you
@Teraprinny
@Teraprinny 9 жыл бұрын
Could you do this on C#, please?
@pearlgirlj
@pearlgirlj 10 жыл бұрын
Hi. 1st, thank u for the video... When i click the search button it doesn't show me all columns. Plus some times it an exception error appears, Why is that happening??
@mkaatr
@mkaatr 10 жыл бұрын
Could you post the error message?
@radugabriel1627
@radugabriel1627 6 жыл бұрын
How can I search for the items in database table without using the % at the end?
@srgdimond43
@srgdimond43 6 жыл бұрын
hello sir,Nice video i am using same format but i have one dateAndtime column datatype datetime ,,,i want to search record between range of time can you please help me that how can i search record using its time...
@morsteen
@morsteen 8 жыл бұрын
I don't understand how making a simple app/frontend that is just a search isn't included as a point and click sort of thing yet. It's probably been around since the DOS database days, but we still have to try to mess with all of this stuff. So many videos, but none of them help me with my own database since I want to be able to search from any of my textboxes/all of my textboxes/combo of my textboxes/only one of my textboxes with one search button to filter the results. Can anyone help? Trying to make my own database of my thousands of photographs as a little project. It's easy to enter the records in Access, but no idea, even after spending two straight days watching video after video on this. It's all either way too complicated of a search, or way too simple.
@mkaatr
@mkaatr 13 жыл бұрын
@sudani1969 Hi there... You could hide the columns you don't want to show simply, click on the datagridview, select edit columns, select the column you want to hide or delete , set its visible to false, or delete it all togather. as for displaying information from two tables in the same data grid, you have to create a new table adapter, then use a query to join both tables, and link a datagridview to that query. hope this help. yours
@mrmksekar
@mrmksekar 9 жыл бұрын
I got "you cannot add or change a record because a related record is required in table" this error. Can you solve this one.
@sudani1969
@sudani1969 13 жыл бұрын
hi Mkaatr still not working for me thanks by the way i'm doing very well following ur tutorial here is my data set name 'AttendanceDataSet1' has 3 tables i wanted to filter 't2' i manged the sql query but i'm failing where to set the dataset and creating tableAdapter i manged it using VS2010 schema bulider i know how to to do it in code when i set dim ds as new data set dim da as mysqldataadapter but this way i failed misreabley any advice
@deathpedal
@deathpedal 13 жыл бұрын
HI SIR CAN YOU POST A VIDEO ON HOW TO "DELETE ALL RECORDS" IN DATABASE? TY SIR... .
@AbuOmar1974
@AbuOmar1974 9 жыл бұрын
Thank you I guess for her to use like '%" etc...... for example I search in to fields "Ar" and Eng" Private Sub TextBox1_KeyUp(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyUp Me.DicDataGridView.DataSource = Me.CoDataSet.Dic.Select("Ar like '%" + TextBox1.Text + "%' or eng like '%" + TextBox1.Text & "%'") End Sub I hope this helpful
@mkaatr
@mkaatr 13 жыл бұрын
@sudani1969 Try this: Dim DS As New AttendanceDataSet Dim DA As New AttendanceDataSetTableAdapters.t2TableAdapter DA.FillByMyFilterMethod(DS.t2,MyFilterValue) This won't work of course because I don't know the names and lots of other stuff, but focus on the idea here. The DS represents all the tables, you need to specify which table should be filled by the adapter. If you still having the issue, send me the DB design, and I will make a video about it. yours
@starkingize
@starkingize 12 жыл бұрын
I want to learn to do that but in vb6
@mkaatr
@mkaatr 14 жыл бұрын
@notta3d Check out the DB tutorials at the website, and see how query adapters can help you perform Update,Insert and Delete. It is the sixth tutorial. Also, the video of the sixth db tutorial is available on the channel. yours.
@deathpedal
@deathpedal 13 жыл бұрын
how to search the id?
@MN-cg2uu
@MN-cg2uu 10 жыл бұрын
dude the gud tutorial
@gligoormarinaada3303
@gligoormarinaada3303 11 жыл бұрын
I salute... Thanks a lot :)
@ghostdumper
@ghostdumper 12 жыл бұрын
Mine wont reconnize the use of "Then" and "elseIf" when im making the radio button... does anybody have a clue or another way to do it?!
@mkaatr
@mkaatr 13 жыл бұрын
@pinmedownbaby Hi there... Sorry about that... hopefully, the next set of tutorials have better audio quality. Thanks for the feed back , and happy new year :)
@mkaatr
@mkaatr 13 жыл бұрын
@sudani1969 Glad that it worked for you. yours
@mkaatr
@mkaatr 14 жыл бұрын
@banglaparade Hi there... could you send me the code, or an image?
@samalex4548
@samalex4548 10 жыл бұрын
how can I contact you in private ? I really need your help if you dont mind
@mkaatr
@mkaatr 10 жыл бұрын
Can't promise I will reply, but the email is: notes@mkasoft.com
@MySwiftblade
@MySwiftblade 11 жыл бұрын
thank you very much srsly thank you:)
@deathpedal
@deathpedal 13 жыл бұрын
how to search ID???????????????
@husseinalihussein2186
@husseinalihussein2186 10 жыл бұрын
Put in your database this code Me.datafilenametableadapter (me._filenamedataset.datafilename)
@morpheushugo911
@morpheushugo911 10 жыл бұрын
Man i cant understand any word you saying can you atleast make a subtitle of this? I mean it's a good lesson but bad sound quality. Sorry
@mkaatr
@mkaatr 10 жыл бұрын
I agree with you. I fixed the sound problem in later tutorials.
@ejies112
@ejies112 12 жыл бұрын
Shhhhhhhhhhhhhh..
@itsjustlester2967
@itsjustlester2967 8 жыл бұрын
the faking view is always moving i cant concentrate on watching
@mkaatr
@mkaatr 8 жыл бұрын
Sorry about that. In receipt videos I changed the recording software so the view is in full screen, which makes thing easier.
VB.NET MS Access Database Tutorial 1 # How to Connect Access Database to VB.Net
18:45
Человек паук уже не тот
00:32
Miracle
Рет қаралды 4,1 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 66 МЛН
Try Not To Laugh 😅 the Best of BoxtoxTv 👌
00:18
boxtoxtv
Рет қаралды 7 МЛН
VB.NET: Making a Student Database (Part 1 of 2)
30:32
BrandonioProductions
Рет қаралды 91 М.
AddEditDeleteSearch(Access VB.net) Using Data Wizard
16:32
endyey Es
Рет қаралды 67 М.
How to Connect Access Database to VB.NET - Visual Studio 2015
13:00
Code And Course
Рет қаралды 228 М.
Search Button for Database in Visual basic 2010
7:27
BasselTech
Рет қаралды 185 М.
5.12 Simple Access search through Visual Basic 2008
5:31
Firchild
Рет қаралды 51 М.
Человек паук уже не тот
00:32
Miracle
Рет қаралды 4,1 МЛН