asp.net (web forms with VB.Net) connecting to a sql database

25,354

The two "best" options are to either use a Table Adapter or Entity Framework.

Both options will give you a GUI interface to build the connection and back end database queries. Entity Framework is the newer technology of the two. Table Adapters are probably easier to learn/understand if your unsure. (Que "easy" comments now)

I would give code examples but you'll have to understand some basics of either for them to make any sense. The basic examples in either link should be enough for what you need.

Both options will give you the ability to databind your datagrid to the results.

Share:
25,354
lazell
Author by

lazell

Updated on February 15, 2020

Comments

  • lazell
    lazell about 4 years

    I'm trying to write a method in VB.net so that when I click a button it queries the database and returns all the values which match a textbox which is located next to the button. I have no idea how to do this, I assume in the onclick method for the button I will need to pull in the value from the textbox, connect to the database and display the results to a gridview?

    Any help is greatly appreciated.

    thanks :)

    Marc