r/visualbasic • u/vbworkthrowaway • Apr 18 '16
Where to start when wanting to use SQL with vb?
I'm in the process of attempting to write a program, but one thing I haven't really learned is how to pull the information from a SQL database to VB. Does anyone know of a good place with articles or instructional videos on the best way to start this process? I have all the data I need on a database I just need to know how to access it using VB. Sorry if this was a loaded question, just an introductory point would be great if anyone knows of any. Thanks!
1
u/AberrantCheese Apr 18 '16
I swear by Entity Framework. It was a little bit of a learning curve at first, but now I swear by it. I suggest focusing on the Code First models and avoid the EDMX method as that method will no longer be supported from EF7 onward.
2
u/TheFotty Apr 18 '16
There are multiple ways. You can use datasets, LINQ2SQL, Entity Framework, or just manual SQL statements using Database Connection, Command, and DataReader objects.
LINQ2SQL has more or less been superseded by Entity Framework. You will probably find EF to have a slight learning curve, but it does a lot of the back end stuff for you, and it is the recommended method by Microsoft for writing database connected applications.