VB.NET Tutorial - SQL Database Search Form With Wildcards (Visual Basic .NET)

  Рет қаралды 15,826

VB Toolbox

VB Toolbox

Күн бұрын

Пікірлер: 44
@jonathankervin
@jonathankervin 9 жыл бұрын
Your tutorials are awesome! Glad you're making more!
@VBToolbox
@VBToolbox 9 жыл бұрын
jonathan kervin Many thanks, Jonathan! I appreciate that. :-D
@devindwight9272
@devindwight9272 9 жыл бұрын
Nice new video!! (and cool thumbnail) Very detailed, step-by-step description of handling DB queries and wildcard searches. Thank you!!
@VBToolbox
@VBToolbox 9 жыл бұрын
Devin Dwight Thanks, Devin! Study hard. There's going to be a quiz at noon. ;-)
@devindwight9272
@devindwight9272 9 жыл бұрын
VB Toolbox Roger that! Also meant to say I enjoyed watching the creation of the updated SQLControl.vb class. I think that class trumps the integrated "Data-binding" feature that VB.NET has to offer.
@OMcsTwosComplement
@OMcsTwosComplement 9 жыл бұрын
Good to see you're back :)
@VBToolbox
@VBToolbox 9 жыл бұрын
Ozma09 Many thanks, my friend. :-) I'd like to be doing so much more. I really, really, reeeeallly wanna get back into GP. Gotta get out of this place if I'm ever going to get the time and mojo to do that. I need to find a programming job that can sustain me. That would be the cat's meow. lol
@joebananas10
@joebananas10 8 жыл бұрын
I'm really enjoying your VB.NET SQL Server tutorial playlist and I have a question. The first few videos use a SQL Server database and then some others use a SQLServerCe database. Can you do a tutorial about creating a single wrapper class for choosing between two different database systems at runtime? So the UI only has to work with a single SQLControl but the SQLControl is a wrapper to two other classes that each connect to their respective database system and depending on a flag or some UI selection data is pulled from either database.
@prixat
@prixat 9 жыл бұрын
How did you know that I wanted to fill and search from a combobox? lol thanks for the great tutorial. I've gone from VS Express to VS Community 2015 and need help understanding all the new 'code help' suggestions it makes. I know its asking a lot but any chance you can give some pointers to refactoring and unit testing?
@Yuggy
@Yuggy 9 жыл бұрын
Are you ever going to do more XNA stuff? I found your tutorials (both on here and on the other channel) excellent :) Something like procedural map generation might be interesting :)
@AardaerimusDAritonyss
@AardaerimusDAritonyss 9 жыл бұрын
***** Hi there, Yuggy553. :-) I really want to get back into XNA, but the changes in my job and life in the past couple of years have taken away most of the time and energy that I have to devote to GP. I'm lucky to get a chance to work on even small projects for VB Toolbox at the moment. I certainly don't want to abandon the channel, but I've been forced to put it on the back burner until I'm able to get in a better position to return to my hobbies.
@Yuggy
@Yuggy 9 жыл бұрын
Aardaerimus D'Aritonyss I'll be on the lookout for more videos on here or the other channel in the future if you do find the time :) You really should look into doing a programming job! I know it's not as simple as it sounds to get one but you're both good at it and enjoy it which is always a good mix.
@second-chance-tv-live
@second-chance-tv-live 8 жыл бұрын
Awesome Tutorial. You are the best. My little problem is I populated my search results to bind to controls like textboxes. But if my search results is empty, it still leaves the current record in my textbox but my datagrid is empty how will it clear my textboxes if no results are found. Thank you
@philmybush
@philmybush 8 жыл бұрын
Wilfred Afagbegee have you tried adding a clear button that has something like mytextbox.text="" and then adding the search code after. other than that I would just create an if error statement where the error handler does the above for you ...sorry I'm a complete noon and I bet you have already tried this, lol
@shawnpaige8138
@shawnpaige8138 9 жыл бұрын
Thank you for creating this tutorial! This is exactly what I was trying to do and then some, I'm so glad you were able to decipher my ramblings. You are awesome! I was able to add the search function as a tab on the SQLApps project framework and it works great but, the loadgrid & getartist is not populating my gridbox or combobox. There are no errors in the code. It's not a big problem but, it was just a really cool bonus I thought would be cool to know how to do. I'm connected to a SQL server DB, it's not imported to the project could that be he problem? Again, thank you for taking the time to do this
@VBToolbox
@VBToolbox 9 жыл бұрын
Shawn Paige Hey, Shawn. Is it pulling up a completely blank DGV or do you see the column names? If you get column names, it's just not filtering properly. If you get no column names, just a completely blank grid then there is likely an error in your query and no Tables are being returned to your DataSet. On the LoadGrid() and GetArtist() we didn't do any error reporting like we did in AlbumSearch(). All you need to do is send SQL.Exception to a messagebox like we did there. You can add it in to the existing IF statement, or you can make another line somewhere after the ExecQuery(). Example: If Not String.IsNullOrEmpty(SQL.Exception) Then MsgBox(SQL.Exception)
@shawnpaige8138
@shawnpaige8138 9 жыл бұрын
VB Toolbox Hi, I am still excited about how well this works! I am able to fill the combobox now, I was playing around with some code that was supposed to load a "sorta" splash screen that didn't work so, I took it out and now the GetArtist & the dynamic query works great. But, the LoadGrid still loads a completely blank grid, I have re-written the SQL a bunch of different ways and I'm including the latest code: Private Sub LoadGrid() SQL.ExecuteQuery("SELECT * " & _ "FROM Albums " & _ "ORDER BY ArtistID ASC, Year ASC ") If String.IsNullOrEmpty(SQL.Exception) Then dgv_AlbSrch.DataSource = SQL.SQLDataset.Tables(0).Rows End Sub Question? My DB is going to be huge, is it feasible to even want this as a feature?
@VBToolbox
@VBToolbox 9 жыл бұрын
Shawn Paige One thing i will recommend for sure is, if you're going to be dealing with a very large dataset, avoid using ' SELECT * '. This can bog your application down pretty badly. I would also limit the number of records initially returned. As for doing a start-up load, that's entirely up to you and how you wish for your application to behave. In your expression above, try taking off the .Rows at the end of [If String.IsNullOrEmpty(SQL.Exception) Then dgv_AlbSrch.DataSource = SQL.SQLDataset.Tables(0).Rows]. I believe that this should be: *If String.IsNullOrEmpty(SQL.Exception) Then dgv_AlbSrch.DataSource = SQL.SQLDataset.Tables(0)*
@shawnpaige8138
@shawnpaige8138 9 жыл бұрын
VB Toolbox That did it, it works perfect! I used the SELECT * just to try to get the simplest query I could think of to see if I wrote it wrong. Thanks again and thank you for going above and beyond to help me out, it is very appreciated
@VBToolbox
@VBToolbox 9 жыл бұрын
Shawn Paige Very happy to be of help, Shawn. :-)
@darshana29
@darshana29 9 жыл бұрын
Thanks
@learnuntildie631
@learnuntildie631 9 жыл бұрын
First viewer :)
@VBToolbox
@VBToolbox 9 жыл бұрын
Learn UntilDie No way! I was here first! haha ;-D
@johnmarkvictorino2788
@johnmarkvictorino2788 8 жыл бұрын
Sir, Do you have some tutorial like making a library system with sql with this collection of tuts so that we can combine all this idea in one project, im having a hard upgrading from vb6 to vb.net, i want to learn much more thanks, more power
@VBToolbox
@VBToolbox 8 жыл бұрын
Hello, John. :-) I don't have any library system source or tutorials specifically, though I do have various projects relating to these topics. Specifically, what topic would you like more information on?
@johnmarkvictorino2788
@johnmarkvictorino2788 8 жыл бұрын
your awesome, i hope you can help me. it may sound demanding but i know that vbtoolbox can help me . i need something like combining this tutorial(vb.net with mssql) into a 1 project. it would be a great to me whos depending in tutorial to learn. more power to you!!! :)
@hoobabooba3034
@hoobabooba3034 8 жыл бұрын
I have a question regarding filling the combo box with the data from database. I have two columns from which i want to take values(which are strings) and populate the combo box with them . But I want to do it so that one item of combo box is actually a Concatenation of these two values which are located in a same row, but different column . How do i do it ?
@hoobabooba3034
@hoobabooba3034 8 жыл бұрын
Nvm, solved it :) Thanks alot for these tutorials ! :)
@austinalthouse
@austinalthouse 9 жыл бұрын
hello, I was wondering if you could make a tutorial on a weather alert ticker that would run via RSS feed that would be a ticker like on The Weather Channel. Thanks!
@VBToolbox
@VBToolbox 9 жыл бұрын
austinlandweatherlab Do you have a sample rss document that I can test with?
@austinalthouse
@austinalthouse 9 жыл бұрын
+VBToolbox You can get feeds from alerts.weather.gov (National Weather Service) you can choose any state and county.
@VBToolbox
@VBToolbox 9 жыл бұрын
austinlandweatherlab I will check that out, thanks. :-)
@austinalthouse
@austinalthouse 9 жыл бұрын
Hi VB Toolbox, I was just checking did you find anything yet?
@bonitowoo5841
@bonitowoo5841 8 жыл бұрын
hi sir good day sir thank you so much for your video good job!. but can i ask one thing im having problem with sqlcmd = New SqlCeCommand(query, sqlcon) and sqlda = New SqlCeDataAdapter(sqlcmd) it give me an error Value of type 'System.Data.sqlClient.SqlCommand' cannot be converted to 'System.Data.SqlServerCe.SqlCeCommand' can you help me what should i do?
@VBToolbox
@VBToolbox 8 жыл бұрын
Hmmm... I don't see an error in the code listed here. My guess is that you accidentally created your initial variable [sqlcmd] as a SqlCommand rather than a SqlCeCommand. Check near the top of your class. :-)
@philmybush
@philmybush 8 жыл бұрын
Great video, thanks. If anyone knows how you can make a search without the order of the string mattering I would like to hear from you. VB.net or VBA Example string: Hello world, how are you today. Example search: how r u world I know you can use wildcards but the order of the string is throwing me.
@antoniostsiriplis9545
@antoniostsiriplis9545 9 жыл бұрын
I have a problem , maybe someone can help me .I have followed step step by steps what says in the tutorial but when i am trying to run the project the database get disconnected and the datagrid get not filled. Any ideas whats going worng??
@philmybush
@philmybush 8 жыл бұрын
Antonios Tsiriplis complete noob here, but this happened to me. check the load event and your database connection
@johnmarkvictorino2788
@johnmarkvictorino2788 8 жыл бұрын
Im loving this tutorial playlist, this helps me upgrading my vb6 programming skills to vb.net. however, im having a problem with the part which you use Params.ForEach(Sub(p) SQLCmd.Parameters.Add(p)) Params.Clear() im having a error from the word "Sub" under the codes of Params say "Expression expected" Please help me, im using vs 2005. im dying to learn VB.Net please someone help me :(
@johnmarkvictorino2788
@johnmarkvictorino2788 8 жыл бұрын
+VB Toolbox sir help
@VBToolbox
@VBToolbox 8 жыл бұрын
Sorry for the delay, John. 2005 does not support Lambda expressions, but you should be able to convert it to a simple For Each loop: For Each p As SqlParameter In Params SQLCmd.Parameters.Add(p) Next Params.Clear()
@johnmarkvictorino2788
@johnmarkvictorino2788 8 жыл бұрын
sir . im very grateful. thank you for your effort.
@yanpolettoangulski5148
@yanpolettoangulski5148 4 жыл бұрын
NICE SQL QUERY SEARCH HOW THE HELL I UPDATE RECORDS FROM SEARCH?
@VBToolbox
@VBToolbox 4 жыл бұрын
Well, that really depends on what your output is. With most form controls, it's as simple as capturing the record ID or primary key and using that in your UPDATE command filter. (I have a video on updates). With DataGridViews, it's much more complex, but I have a tutorial on that topic as well. Main limitation there, is that you can only update from single table queries (not joined).
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 1 МЛН
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 14 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 59 МЛН
Visual basic.net: retrieve data from access database- in VB.net
11:15
Programming for Everybody
Рет қаралды 25 М.
VB.NET Tutorial - Update Records In An Access Database
57:04
VB Toolbox
Рет қаралды 31 М.