Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How Do You Execute SQL Script From Visual Basic?

0
Posted

How Do You Execute SQL Script From Visual Basic?

0

The latest version of Visual Basic provides a rich data access layer that allows for object-oriented abstraction of the data used in an application. Sometimes however, it is more efficient, quicker or more practical to simply execute a SQL script against the underlying database directly. A SQL script may contain multiple statements that need to be executed together or it may have dynamic SQL that is generated by the application. Regardless of the reason, executing SQL scripts from within Visual Basic is not very difficult. Create a new Visual Basic Windows Forms project in Visual Studio by selecting New Project from the File menu and selecting the appropriate project type. In the default form that is created, form1, place a button control named Button1. Double click on the control to create a Button1_click event handler. At the top of the code listing for Form1 (above the line “Public Class Form1”), add an imports statement to import the .NET data access library. The statement should l

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123