
© 2010, DataObjx L.L.C. Meriden Connecticut USA

DataObjx L.L.C.
Custom built desktop applications utilizing the Microsoft .NET Technologies...
Custom Web & Desktop Application Development



Private Sub btnUpdateData()
Dim SQL As String = ""
SQL = SQL & "Update tblUsers Set first_name = 'Tommy', last_name = 'Thumbs' Where ID = 2"
1) Dim DAL As New DataAccessLayer.VistaDB
2) DAL.ConnectionString = "Your connection string here..."
3) DAL.ExecuteNonQuery(SQL)
End Sub
Example Usage -
Demonstrates the DAL performing a SQL Update statement in three (3) lines of code.
In Step 1 The DAL is instantiated.
In Step 2 The Connection String to your SQL Server database is applied to the DAL and
In Step 3 The SQL command is executed
Private Sub btnDeleteData()
Dim SQL As String = ""
SQL = SQL & "Delete From tblUsers Where ID = 2"
1) Dim DAL As New DataAccessLayer.VistaDB
2) DAL.ConnectionString = "Your connection string here..."
3) DAL.ExecuteNonQuery(SQL)
End Sub
Private Sub btnInsertData()
Dim SQL As String = ""
SQL = SQL & "Insert Into tblUsers (last_name,first_name, password, login) "
SQL = SQL & "Values "
SQL = SQL & "('Thumb','Tom','fingers','smallguy') "
1) Dim DAL As New DataAccessLayer.VistaDB
2) DAL.ConnectionString = "Your connection string here..."
3) DAL.ExecuteQuery(SQL) 'Execute & get the Primary Key (ID) of the new record
MsgBox("@@IDENTITY = " & DAL.PKID.ToString, MsgBoxStyle.Information, "PKID")
End Sub