Imports System.Data.Sql
Imports System.Data.SqlClient
Public Class Form1
    Dim connetionString As String

    Dim connection As SqlConnection

    Dim adapter As New SqlDataAdapter

    Dim sql As String



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim connetionString As String

        Dim cnn As SqlConnection

        connetionString = "Data Source=obeng\obeng;Initial Catalog=mangementsystem;integrated security=true"

        cnn = New SqlConnection(connetionString)

        Try

            cnn.Open()

            'MsgBox("Connection Open ! ")

            cnn.Close()

        Catch ex As Exception

            MsgBox("Can not open connection ! ")

        End Try
    End Sub

Is there a question? How does the code relate to the title? A datareader is not used to insert data into a table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.