Hi Folks,
I wrote this code below that renders no error when ran; however, it does nothing. Ideally, I would like the code to display the data in the table on the form ... I don't get what I am missing. I am just starting out trying to create database apps in visual studios .net 2010 using sql server as a back end and vb code as front end ... any help would be greatly appreciated.
Imports System.Data
Imports System.Data.SqlClient
Imports System.Xml
Public Class Form1
Private m_CB As SqlCommandBuilder
Private m_DataTable As New DataTable
Private m_cn As New SqlConnection()
Private m_rowposition As Integer = 0
Private m_da As New SqlDataAdapter
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
m_cn.ConnectionString = "Data Source=SQLDATA;User ID=HEKTOR;Password=RYANZ;"
m_cn.Open()
m_da = New SqlDataAdapter("select * from [HU]", m_cn)
m_CB = New SqlCommandBuilder(m_da)
m_da.Fill(m_DataTable)
End Sub
End Class
I wrote this code below that renders no error when ran; however, it does nothing. Ideally, I would like the code to display the data in the table on the form ... I don't get what I am missing. I am just starting out trying to create database apps in visual studios .net 2010 using sql server as a back end and vb code as front end ... any help would be greatly appreciated.
Imports System.Data
Imports System.Data.SqlClient
Imports System.Xml
Public Class Form1
Private m_CB As SqlCommandBuilder
Private m_DataTable As New DataTable
Private m_cn As New SqlConnection()
Private m_rowposition As Integer = 0
Private m_da As New SqlDataAdapter
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
m_cn.ConnectionString = "Data Source=SQLDATA;User ID=HEKTOR;Password=RYANZ;"
m_cn.Open()
m_da = New SqlDataAdapter("select * from [HU]", m_cn)
m_CB = New SqlCommandBuilder(m_da)
m_da.Fill(m_DataTable)
End Sub
End Class