I have a main form with datagridview attached to the form. i calling datagridview when the form load, but am getting the 'property access must assign to the property or use it's value. Please help me correct the error.
Attached is the form to help analysis the problem.
thanks
Gyamfi
Imports System.Data.SqlClient
Imports System.Data
Imports System.Data.DataSet
Imports System.Data.Sql
Imports System.Data.SqlTypes
Public Class Daily_Susu_Collection
Dim ConnectionString As String
Dim Sql1, sql2 As String
Dim da As SqlDataAdapter
Dim ds As New DataSet
Private Bindingsource As New BindingSource
Private DataAdaptor As New SqlDataAdapter
Dim connection As String
Dim con As New SqlConnection
Dim put, fresh As String
Private Sub Daily_Susu_Collection_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ConnectionString = "Data Source=GYANFI-PC\SA;Initial Catalog=Susuproject;User ID=sa;Password=303444"
Call Susu_Savings()
Call FillCombo(cboDepartment, "DepartmentID", "DepartmentName", "Select * from tblDepartment")
End Sub
Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click
Dim cn As New SqlConnection(ConnectionString)
cn.Open()
Dim cmd As New SqlCommand("Select * from Trans_Details ", cn)
DataAdaptor = New SqlDataAdapter(cmd)
Dim CommandBuilder As New SqlCommandBuilder(DataAdaptor)
Dim Table As New DataTable()
Table.Locale = System.Globalization.CultureInfo.InvariantCulture
Me.DataAdaptor.Fill(Table)
Bindingsource.DataSource = Table
Susu_Savings.DataSource = Bindingsource
Dim data As New DataSet
data.Locale = System.Globalization.CultureInfo.InvariantCulture
End Sub
End Class