Go Smart with REAR (pRay, rEad, leArn, tRy)

11/28/2016

LEARNING VB.NET (WITH SQLSERVER AS DATABASE) PART.1

5:35 PM Posted by Vandaime No comments
First of all, we need to create a connection module which serve to connect the data manipulation that we create in VB.NET connected with the database that we created before. This is the script:

Imports System.Data.SqlClient
Imports System.Data

Module Connection
          Public koneksi As SqlConnection = New SqlConection (My.Settings.ConnectionStringApp)
          Public con As SqlConnection
          Public cmd As SqlCommand
          Public str, username, password As String
          Public da As SqlDataAdapter
          Public ds As DataSet
          Public dr As DataReader
          Public dt As New DataTable

          Sub koneksi_DB()
                 STR = "Data Source=.\tr45h; Initial Catalog=nilaiSiswa; User Id=sa; Password=*******"
                 con = New SqlConnection(STR)
                 If con.State = ConnectionState.Closed Then
                    con.Open()
                 End If
          End Sub
End Module

And then, add new form to be used as a login form. 

0 comments:

Post a Comment