If by Visual Basic, you mean VB.Net then I find these videos to be useful for beginners.
If you meant VB6 then I would suggest you learn something newer.
GitHub has its own application which is significantly easier to use to manage GitHub repositories.
Since you already started the process with Visual Studio, before this process begins, you may have to navigate to your folder with the .sln
file and delete the .git
folder and any file which begin with .git
it may have created.
Anyway, to do this with GitHub Desktop:
File
, then click New Repository...
Choose...
and navigate to the folder your .sln
file is in and select that folder.VisualStudio
. Select or don't select a license. It's not required. MIT License
is standard.Create Repository
, then click Publish Repository
on the far right just below the menu bar.Simple. No weird hoops to go through like Visual Studio makes you go through.
I can't really recommend any current books (I stopped buying them years ago), but this video series should get you going:
http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners
Beyond that, If you are doing web then go through ASP.NET and all of the content there, and either way dig deeper into the videos on Channel 9.
The only book recommendation I have would be to see if you can find something by Rod Stephens. I do have some older versions of his books and they were quite thorough.
Small Basic (Microsoft, free) is a good place to start with the basics.
Kodu Game Lab (Microsoft, free) will make game building easier.
You'll have to code the paste function yourself by parsing the content of the clipboard.
Here's a detailed article with info on how to do it:
http://www.codeproject.com/Articles/36850/DataGridView-Copy-and-Paste
It's in C#, but should be pretty straight forward. If you aren't comfortable reading C# yet, you can run the code through a converter: http://converter.telerik.com/
I can't recommend this enough
http://channel9.msdn.com/Series/Visual-Basic-Fundamentals-for-Absolute-Beginners
Great short videos that you can watch over and over, plus you can jump right to the video that discusses a specific topic.
Absolutely...
I'm completely self taught, have been programing professionally for over a dozen years, write in a handful of languages, was a senior level dev at my last job, and have owned my own company for about 6 years.
Getting the basics is easy enough, getting a really deep understanding will require a lot of dedication, and a never ending process of learning, but it can be a really fun hobby.
Like melot2K1 said, you really want to focus on fundamentals of programing, and not specifically VB, once you get past the beginning stages. Understanding this larger picture allows you to see beyond the constraints of one language, and opens up a lot of other opportunities.
The link below is a great place to start:
http://channel9.msdn.com/Series/Visual-Basic-Fundamentals-for-Absolute-Beginners
Stop using your powers for evil!
Having said that the problem you are going to have is that there is no easy way to fire an event when they are watching Netflix. Even with windows messaging it would be tough. I suggest using a timer and launch the script when the browser is launched and set it up for a specific wait period, that way you can easily get rid of it as well.
The timer function returns number of seconds (and milliseconds) since midnight, Snag the variable when your scripts starts. Create a loop that loops while current time is less than start time + 15 mins (or whatever) something like this;
Dim StartTime StartTime = Timer + {whatever you want} Do 'do idle code or nothing Loop While Timer < Startime
This would be much easier in .NET for you could just wait for the internet browser to open and by grabbing the window title using windows messaging (The code provided uses the win32 windows message hook) close the browser and bring up a window to do what you want.
Here is an article from CodeProject by Tomzhu that explains it fully.
hemmmm, Maybe I should take a run at this it could be fun.
-Bone
I have used monogame which is the succesor to XNA in VB without issue. I have coded with over 100k 2d objects without issue.
https://www.codeproject.com/Articles/1175671/Getting-Started-with-MonoGame-using-Visual-Studio
https://stackoverflow.com/questions/16921080/read-a-file-line-by-line-with-vb-net
Dim reader as StreamReader = My.Computer.FileSystem.OpenTextFileReader(filetoimport.Text) Dim a as String
Do a = reader.ReadLine ' ' Code here ' Loop Until a Is Nothing
reader.Close()
All you have to do at this point is find the line you're looking for and parse it out.
Wouldn't it be simpler to just disable "Fast User Switching" on the PC?
http://www.bleepingcomputer.com/tutorials/disable-fast-user-switching-in-windows/
If you still prefer to list them, you can adapt the C# code from here: http://stackoverflow.com/questions/132620/how-do-you-retrieve-a-list-of-logged-in-connected-users-in-net to VB to enumerate the currently logged in users. I believe you also need administrator access to do so.
Man this brought back some memories, I did this one for school 30 years ago >.< in C
Here is a quick implementation in VB console app as always :) Check how the pivot is handled by binary splitting right at the top using an iComparable.
Public Sub Main(args As String()) ' Implementation of ' http://www.wikiwand.com/en/Quicksort
' Create array to sort Dim sortArray As String() = {"t", "x", "a", "r", "s", "w", "k", "g", "o"}
For x = 0 To sortArray.Length - 1 Console.Write(sortArray(x) + " ") Next
Console.WriteLine()
Quicksort(sortArray, 0, sortArray.Length - 1)
' output array For i As Integer = 0 To sortArray.Length - 1 Console.Write(sortArray(i) + " ") Next
Console.WriteLine()
Console.ReadKey() End Sub
Public Sub Quicksort(atom As IComparable(), left As Integer, right As Integer) Dim leftInt As Integer = left, rightInt As Integer = right Dim pivot As IComparable = atom((left + right) / 2)
While leftInt <= rightInt While atom(leftInt).CompareTo(pivot) < 0 leftInt += 1 End While
While atom(rightInt).CompareTo(pivot) > 0 rightInt -= 1 End While
If leftInt <= rightInt Then Dim tmp As IComparable = atom(leftInt) atom(leftInt) = atom(rightInt) atom(rightInt) = tmp
leftInt += 1 rightInt -= 1 End If End While
If left < rightInt Then Quicksort(atom, left, rightInt) End If
If leftInt < right Then Quicksort(atom, leftInt, right) End If End Sub
No, but here's a link to some very great videos that will help you get started.
Visual-Basic-Fundamentals-for-Absolute-Beginners
VBNET is fine and I like it overall, but if you want to learn programming as a hobby and just, you know, have some fun coding fun stuff (and not build some management system), I would suggest you to try Processing instead. ( https://processing.org/ )
Processing is built on java, so you can find about any answer you need either as questions about java or questions about Precessing (it's well documented). There are a lot of material like tutorials available, especially to build small games.
Hell, it's practically made for writing small games and learn the ropes! It's also open-source.
I don't think you understand what I'm saying. getting the color of anything outside of your script/program is NOT trivial. the "easy" way is you take a screen shot, analyse the bitmap image for colors, and go from there. or maybe you don't know what trivial means?
It shouldn't be too difficult to tweak it so that it spits out into a CSV-style file instead of a txt file. Just got to change the way it formats the information slightly, is all. Here's the source code for you to have a go at it. Hope it helps!
Actually, I thought it would have been interesting for me to give a go at coding this, so here you go!
https://anonfiles.com/file/fd273c39c3d6d23655a790bc9bf0c46f
This will generate the serials into an output.txt in the same directory.
Not sure how much time you have, but the following video series (with code) should give you a solid overview of most of that.
http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners
You need to create your application as a service. This sets the program to be a background worker and it runs all the time.
You will need to learn about OpenXML openxml is Microsoft document format for MS Office. Basically it boils down that any Excel, Word or office document is a zip file that contains a bunch of XML and text documents describing the contents of the file to the given office program.
There is also the option of using OLE Automation (A bit older but still works) to open the CSV in EXCEL modify columns and then save it back out as a workbook.
Any ways Check these out
http://msdn.microsoft.com/en-us/library/hh180830(v=office.14).aspx
http://www.codeproject.com/Articles/670141/Read-and-Write-Microsoft-Excel-with-Open-XML-SDK
Good luck with this and if you want you can post or PM and I will help where I can.
You posted this a month ago, so you've probably already found a solution. And while I've never tried this, my curiosity got the better of me and I began a search. What you're trying to do is known as: drawing a control in the "non-client area" of a windows form.
I recommend doing some VB.NET related searches. But here are some links to C# code that you may be able to port for your needs.
A good explanation of the non-client area and some C# code: http://www.codeproject.com/Articles/32623/Vista-Aero-ToolStrip-on-Non-Client-Area
Something I read suggested using an API call to GetDesktopWindow() to obtain a handle to the desktop and using SetParent() to set your control's parent to the desktop: http://www.hightechtalks.com/dotnet-framework-winforms/how-create-control-non-client-205028.html
Good Luck!
Yep, it's server based and you can control access via a number of different methods.
http://www.asp.net/web-api/overview/security
Your desktop app would just connect via HTTP and push the data as an XML or JSON package, then the server side app would convert that package and push it into the DB.
this guide seems sane http://www.tutorialspoint.com/vb.net/vb.net_arrays.htm
if you were using the msdn result that's the top of google results and stopped at the first example, I can see how you were confused. I find that one confusing too.
Hey Narf Squared. I just started teaching myself visual basic as well. Try this out. Please share anything that you have found to be good as well. I would really appreciate it!
Thanks!
I haven't done systray apps but I don't think you can change the colour of the icon. You have to instead change the icon itself. That's why I was suggesting using multiple icons instead of trying to change the colour.
Visual Studio has a bunch of free developer tools. They are full-featured, not stripped down. Most professional developers use the free tools unless they are in a company that's big enough that they don't comply with the license rules.
https://visualstudio.microsoft.com/free-developer-offers/
For this you probably want Visual Studio Community. Visual Studio is a bit overwhelming at first but just follow the tutorials you find online and you just use the 2% of the overall functionality that you need.
Not sure what is going on with that example but it's pretty old. Does this one help at all? http://forum.codecall.net/topic/69309-writing-and-reading-xml-files-vbnet-part-i/
Also, do you have some constraints that are forcing you to use xml? SQL Express is free for databases up to 4 or 8 G (I can't remember for sure) and it would be a much more modern (and easier) way to read and write your data, as you could use entity framework. For that matter, you could even just add a service based database to your project, which is basically a flat file db, where you could create tables and what not in visual studio, and then just use EF on that.
If you have to use xml and are still running into issues after that other tutorial, let me know some specifics on where exactly you're having problems and I can help more.
this is the book we used in my vb.net class I thought it was good at teaching the basics of programming in vb.
Did a section. Since it seems to be a lot of repeating I did some. Disclaimer though I am also a beginner so what I did could very well be wrong and if so anyone please correct me.
maybe your smtp library isn't closing the file? maybe someone else has it open over the network?
does fileDestination hold the path and filename or just the path? the manual implies that it should have the filename, based on the examples.
try using http://technet.microsoft.com/en-us/sysinternals/bb896645 to see what's holding onto it. if it's on a file server, run this on the server too. if it's a samba server, use smbstatus from the server's command line/ssh.
Okay, I think I get what you're saying now. When the user clicks itemAB's (user control) btnRemove, it raises the event isRemoved, which then calls the btnRemove_Click method again? Is that right?
So my approach is not correct then? How would I know if the user clicked the btnRemove from the instantiated ctrlAB user control?
Edit: So I looked up another discussion from Stackoverflow, is this how it should be then?
'Form Class Private Sub btnAddAB_Click(sender As Object, e As EventArgs) Handles btnAddAB.Click flagABChanged = True
If cntABCurrent < 51 Then itemAB = New ctrlABtic itemAB.Top = cntABCurrent * 40 itemAB.Left = 0 itemAB.Name = "ABtic" & cntABCurrent.ToString AddHandler itemAB.isRemoved, AddressOf RemoveAB
pnlABtics.Controls.Add(itemAB) _AB.Add(itemAB) cntABCurrent += 1 End If End Sub
Private Sub RemoveAB() MsgBox(itemAB.Name, , itemAB.IDABtic) End Sub
'================ 'User Control Public Event isRemoved() Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click RaiseEvent isRemoved() Dispose() End Sub
>As I said in my post, I tried that.
Well, you didn't exactly say that:
>Perhaps I forgot to import some library in the project references somewhere. I can't remember. I originally did this years ago.
I can absolutely guarantee you that Speech.Synthesis
is still available. It has not been removed, Microsoft are not in the business of removing classes from existing frameworks. The assemblies that are available to you to use have nothing to do with Visual Studio version.
You can't see Speech.Synthesis
in the References Manager because in your screenshot, you're looking at COM/Type Libraries. Not Assembly Libraries. Speech.Synthesis
has never been a part of a Type Library that I am aware of.
What version of the .NET Framework are you using? The lack of Assemblies tab in your References Manager leads me to believe that you're using .NET Core.
If you're using .NET Core you can't directly reference assemblies, you need to import them into your project via NuGet:
> but I am also thinking bluetooth would be easier, but im not sure vb would support something like that.
A quick search shows that it might.
>so likely end up using SOAP.
So, for the VB part of it, you'd need to connect to the Internet and handle SOAP. NuGet has plenty of SOAP packages, so while there'll be a learning curve, it ought to be relatively easy.
You could use WebClient instead of HttpClient if you just need to do a simple request. I'd suggest using the Newtonsoft.Json Nuget package https://www.nuget.org/packages/Newtonsoft.Json/ to handle the json.
Super basic starter example:
Dim client As New WebClient Dim response As String = client.DownloadString(urlGoesHere) Dim json As JObject = JObject.Parse(response)
From here you should be able to grab information from the json object
It sucks when your teacher can't help you as much as you would like and I am sure that she feels the same way. It is what it is. The book that was given you is not bad. As a jump start I would use these videos;
http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners
You and your classmates watch the first 10 videos then and get back to me. I can help you get this program completed once you are aware of the fundamentals. These videos are recommended almost all of the programmers I trust here on /r/visualbasic.
I agree with you 250 minutes is a bit short considering the level of knowledge that is being presented. It is not impossible though, you have to choose if you want to put the effort in and learn programming. The channel9 videos will give you a huge jump start.
I am also willing to help you and any of your friends in the class. Hell if you come here there are great people Charlie, Postal, Rob, and a bunch of others who will bend over backwards once they know you are truly interested in learning programming.
You should be looking at a class called FastDirecotryEnumerator I have used it for years. It uses underlying windows calls to enumerate directories and files around 8X faster.
http://www.codeproject.com/Articles/38959/A-Faster-Directory-Enumerator
The class is in C# but i just put in my vb application and instantiate as a regular class in vb and it works great.
Is there a reason you don't want to use the FileSystemWatcher?
Also i am not sure if i understand why you want to achieve that with background workers. Are the files large?
If this is just a school course, just download visual studio for mac and use that (https://visualstudio.microsoft.com/vs/mac/ <- visual studio for Mac.) Then download the latest sdk (.net 5) for mac and use that for any app you build. This setup alone will work without any additional tools.
There should be rest full state web API that your applications interact with that can Send and Receive state messages too and from the clients. I would also use docker containers and have the networking only talk to the MYSql server directly with no exposure of the ports to the server itself. I also echo what /u/LondonPilot has said and SignalR is a great library for asyc updates.
Lastly if I was doing this I would implement the Matrix protocol which has all this built into it.
I liked the one Trello had for a while on their /jobs/developer page:
trello.com/jobs/developer on Archive.org
1318245405976014891
working from the original word documents is much easier. Here is a docx plugin I have used for getting and modifying information in word documents.
https://www.nuget.org/packages/DocX
and the github repo
You're missing libraries associated with the project. They were likely installed as a developer pack and reside in a different directory to the project itself.
Add the required libraries to your project here:
The System.Management.Automation can be accessed via VB but for the amount of work you would have to do to get this to behave I would stick with Powershell.
If you want to give it a shot there is a nuget package to add it to your .net application
https://www.nuget.org/packages/System.Management.Automation/
Do you need to do a settings file from scratch? Can you use the built in config files? Or xml serialization? Or one of the many many config libraries for .net https://www.nuget.org/packages?q=config
its easy to reverse the windows key from the registry, but why write it. There is a product called ProduKey or SoftKey Revealer That does it already.
If you want to write a function to do this by giving it a specific value then replace the code that grabs it from the registry with the value you want. See the code below. Place you value in quotes in the {value goes here} section.
Set WshShell = CreateObject("WScript.Shell") MsgBox ConvertToKey({value goes here})
Function ConvertToKey(Key) Const KeyOffset = 52 i = 28 Chars = "BCDFGHJKMPQRTVWXY2346789" Do Cur = 0 x = 14 Do Cur = Cur * 256 Cur = Key(x + KeyOffset) + Cur Key(x + KeyOffset) = (Cur \ 24) And 255 Cur = Cur Mod 24 x = x -1 Loop While x >= 0 i = i -1 KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput If (((29 - i) Mod 6) = 0) And (i <> -1) Then i = i -1 KeyOutput = "-" & KeyOutput End If Loop While i >= 0 ConvertToKey = KeyOutput End Function
well that was confusing. cmd = command prompt.
instead of cmd.open
, you want Set rs = cmd.Execute()
and then rs is your RecordSet object that holds the results of your query. SQL queries return resultsets, not text values, even if the result is 1 row and 1 column.
http://www.experts-exchange.com/articles/3626/ASP-Classic-Using-Parameterized-Queries.html
Never mind then, if you have to generate all primes up to the starting point, it will be much too slow.
The number range I gave is from this problem which give you a maximum of 6 seconds to get the answer.
http://www.datafilehost.com/d/fe2fff91
I couldn't get a decent printout of the app's output, but if you are running Windows XP or a virtual machine, then you can run the actual program yourself. I linked it up top.
No problem.
When you need to compare to pieces of code, I suggest using WinMerge
WinMerge highlists differences between similar lines (screenshot). You can easily see "ud =" is missing from the code on the right. The longer the similar code is, the more time you'll save...
It looks like you are doing logging, you should consider replacing this custom built solution with something like nLog. http://nlog-project.org/
It's super easy to write to a file and also to back up that file to a zip file, also write to the event log, a database, the network emails, rss, messageboxes, windows forms, message queues, debuggers, consoles, cats, dogs, babies, whatever....
For instance the file target has automatic archiving that allows you to archive when files get too big, after a certain amount of time and I'm sure other options as well. https://github.com/nlog/nlog/wiki/File-target
IMO, unless you need to learn VB6 for work, I'd skip it.
.NET is just as easy to learn, and you'll save yourself a lot of time and energy learning something that is very old and outdated.
There's more to learn with .NET, but you don't need any more of it than you do with VB6 to get started (the IDE is basically identical).
I'd start here: http://channel9.msdn.com/Series/Visual-Basic-Fundamentals-for-Absolute-Beginners
Grab a free copy of VS Express here:
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
Just through years of enjoying working with computers.
You might want to check out:
http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners
I think it's a great starter for basic fundamental concepts (variables, loops, conditions, etc...) They're fairly short videos, and things are explained very clearly. I recommend them to anyone starting out that is trying to do this on their own.
Personally I avoid domain specific books at this point, since they tend to be outdated by the time you get half way through them.
This video series will give you a good intro: http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners
If you feel you really need a book, then a used copy of the following is probably a good place to start:
http://www.amazon.com/Visual-Basic-2012-Programmers-Reference/dp/1118314077/ref=pd_bxgy_b_text_y
A Listbox can have multiple columns as well as rows. I would suggest you add 9 columns and then it will be easy to do what you want.
Actually as I am thinking about this I would use a GridView control. Then you can take the click events and actually do inline editing.
http://www.codeproject.com/Tips/730206/Sudoku-Generator-using-DataGridView
ah I see, you are using GDI+ usually for something like this I would use the system.drawing.2d namespace
If you want to use GDI+ i would look at this control GraphSheet Control For Windows by Harish Palaniappan
let me go through the code and see what is going on. Back later :)
Please put a bullet in my head. The table layout control should have been shot and buried in .NET 2.
I did have an article bookmarked from a guy Hassan Mokdad - Designing the Layout of Windows Forms using a TableLayoutPanel, with auto-expand panels
he goes into details of the internal workings of the control so maybe you can pick out what is going on with your code.
I cant see what is causing it from your code. Do you have a git repo or a zip I can snag?
Using interop sucks for generating documents. Since DOCX is a zip you can open it up and modify the XML that is the document using regular expressions if you want.
I found this usefull when I had to do what you are doing.
http://www.codeproject.com/Tips/666751/Use-OpenXML-to-Create-a-Word-Document-from-an-Exis
The kernal32.dll is significantly faster at enumerating files for it bypases the .net layer which is very top heavy. Check out this article at codeproject for a c# implementation. Dont forget you can bring a c# class into vb and use it directly. You dont need to convert the code. This should fix your problem.
Bone
Thanks man -- In this tutorial:
http://www.codeproject.com/Articles/751897/ASP-NET-Identity-with-webforms
I hit a roadblock where I need to "Add the OWIN startup class". I already added OWIN via package manager like I was told, went to add class, and OWIN not found at all. Using Visual Studio 2013 pro. I tried following the instructions again, and googling to try yet again, but to no avail. OWIN class is..no where to be found! Ugh..
Oh if you want to do crossfade use the WINDOWSMEDIAPLAYER class here is a chunk of code you can use. its a c# class but you can just load it into your program and use it directly.
http://www.codeproject.com/Articles/125413/Media-Player-Class
You could take simple Windows utilities like Calc.exe or Notepad.exe and try to reproduce those as exactly as possible (although the advanced modes of calc.exe will take a lot of work).
You could try some simple games like hangman, tic-tac-toe (3x3 is boring, but 4x4 or larger can be interesting) or battleship. You could check out some GDI graphics pages and experiment with that.
You can check out "programming challenges" pages like CodeAbbey.com and see how many of the problems you can manage to solve...
Hey welcome to the sub.
http://www.tutorialspoint.com/vb.net/vb.net_variables.htm
I think you are looking for this ;
Module variablesNdataypes Sub Main() Dim a As Short Dim b As Integer Dim c As Double a = 10 b = 20 c = a + b Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c) Console.ReadLine() End Sub End Module
as an example
The truth is that VB. NOT has nothing to show. If you disagree, show me the code ! :) VB6 does not need lobbying since it has higher speed than C++ (I am referring to VB6 functions combined with machine code - available on PSC)
As a last comment, take this native compiler made in VB6: https://sourceforge.net/projects/visual-basic/?sourcFurthere=directory
but, if you say so ... :)
That is the correct track. I would look at using something like postman (https://www.postman.com/) which will give you the testing tools needed to develop the two separate parts of the project independently of each other. Get a solid API then choose the best interface solution that fits your needs. I would also suggest JSON Web Tokens as the best method of securing the communication between your API and your interfaces.
The great part about structure is that it makes adding bots, and other systems trivial for you can write them independent of your communication platform. This is actually the method that Slack uses.
This is the exact path we used for our in service messaging system, and it works well.
Not sure if I understand the question, but, just in case it is what you are looking for:
there is also a (beta) version of visual studio that support full dev cycle for .net. ( not visual code ).
https://visualstudio.microsoft.com/vs/mac/
Not sure if it have vb support though.
Edit: changed to English url.
Hello! I am not sure what is your problem indeed. If you want to see the IDE in other visual style (like in the mentioned textbook), this is probably not possible. You can try to find previous version downloads e.g. here: https://visualstudio.microsoft.com/vs/older-downloads/
Might be too late for OP, but for anyone else who's interested.
I recently had to find VS 2015 (Solidworks' API only supports 2015), and found this link. You can download them as .iso files as well as the web installers.
> I haven't done systray apps but I don't think you can change the colour of the icon. You have to instead change the icon itself. That's why I was suggesting using multiple icons instead of trying to change the colour.
I see. I was thinking that the program could change the color of the circle WITHIN the icon on the fly. But if that's not possible, then, yeah, having two icons would be best. Thanks.
> https://visualstudio.microsoft.com/free-developer-offers/
>
>For this you probably want Visual Studio Community. Visual Studio is a bit overwhelming at first but just follow the tutorials you find online and you just use the 2% of the overall functionality that you need.
Thanks! Bookmarked it.
I use Pdftotext, It converts a PDF to its text equivalent. Its part of the XpdfReader suite.
https://www.xpdfreader.com/pdftotext-man.html
I use the process.start method to put all the content of a pdf into a file
Process.Start("C:\path_to\myapp.exe option1 option2")
I wait for the process to exit and then I load the file created into a string and work on it from there.
dim pdftext as string = file.readalltext("{path}")
At this point it becomes text manipulation. Let me know if you want some more information on that.
EDIT: I cant type without my coffee, had to fix the stuff that I thought was English but turned out to be some odd hybrid of Klingon and chicken scratch. don't judge...
The code doesn't give me any errors, the datagridview shows the correct database (with columns rearranged for some reason).
When I press Button1, nothing happens.
It did give me some errors. Instead of Cint in the q-string, I've used Cstr. This removed any errors I got, as the value I'm trying to write is not integers.
I've studied the youtube video I linked earlier for hours, and I just dont get it. His code works perfectly.
Thank you for your help u/Bonejob I'd like to note that we haven't yet learned about the form.state method, but we did learn about the datagrid in the last chapter.
I've copied my code here
Unfortunately a lot of the new/cool resources like Codecademy tend not to support VB, even though VB is a great language.
A basic POS in Visual Basic is definitely doable.
https://www.amazon.com/Visual-Basic-2015-Unleashed-Alessandro/dp/067233450X is a pretty good book on my shelf, though it's more of a reference than a tutorial... I learned VB 6 over a decade ago with the older version of https://www.amazon.com/Visual-Basic-Hours-Teach-Yourself/dp/0672337452
Your questions would be well answered by this book:
https://www.amazon.com/CLR-via-4th-Developer-Reference/dp/0735667454
I realize it's "CLR via C#", but it's really about dotnet itself (the CLR) so the information is just as applicable to VB.net (and powershell to a degree).
A tiny bit of background; I started with VB 2.0 (yea yea yea, I'm old, I know) and used books to learn things, and there is value there... but I wanted to warn you that you're gonna need a lot more. Also books get old before they are released. So be aware of that too.
Since you mentioned VBA and a book I am assuming you are new to all things. Because of that I highly recommend VBA for Dummies. The Dummies books tend to be a good primer and are easy and fun to read.
Ok, that said, welcome to the world of development.
I bought this and have done pretty well.
Beginning Visual Basic 2015 https://www.amazon.com/dp/1119092116/ref=cm_sw_r_cp_apap_2H4QxGftOM7Rp
I code every day and use the internet as a resource and not a place to just find the code I'm looking for. That I feel is an important distinction.
In 4 months I have learned enough to code a program my company uses all day as an order management data center.
> I designed the interface in the past and it isn't great but I have to stick with it for the purpose of this exercise
ok, I hear you... and since this is a school thing I will leave it at that.
What you are going to need is to pass the data created in Form1 to Form2 BEFORE you close or hide Form1. You can do this by an exposed property or variable. It is generally considered a bad idea to pass data directly to a public variable. The reason/value of passing data to a public property is that you can allow for data validation (or other business rules) in the property.
It is passing values to these forms and not keeping alive a place where the values are stored. You create a cart class in Form1, then add values to it, then open Form2 but don't pass values to it. Even when you do, you need to pass those values back to Form1 when Form2 is completed it's action. This is the problem, how you are passing the data around. You will need to pass the data from Form to Form... I know this is a lot, but once you get it the process gets easier.
Food for thought about UI:
The UI pattern you are creating SEEMS to be some of the cause of your problems/confusion. I read a book a long time ago that I still highly recommend; About Face by Alan Cooper (he created VB) One point he made is that opening a new form/window is akin to making a customer in a retail/real-world store go into another room to do a specific task. ie: Get the items in this room, then go into another room to pay for it.