VB.NET DBHELP

Code Recommended links: Windows 7 feature news channel: Economic Observer, the four prediction: the rise of the national power network PrivateSub Form1_Load (ByVal send erAs System.Object, ByVal eAs System.EventArgs) HandlesMyBase.Load Dim objServAsNew DbService.Db_Webserv Dim retValAsInteger retVal = objServ.connectToDB () If retVal = 1Then txtMessage.Text = “Connected to database successfully.” Dim dtstAsNew DataSet dtst = objServ.getProducts () dtgrdProducts.DataSource = dtst.Tables (0) Else txtMessage.Text = “Unable to connect to the database, check the connection information “EndIf End Sub DbHelper.vb Imports System.Data Imports System.Data.SqlClient Imports System.Configuration PublicClass DbHelper

Tags: , ,

Leave a Reply