When I`m trying to run following code, i receive in listboxAmount the following message: System.Data.DataRowView
Anybody got an Idea why?
Anybody got an Idea why?
Code:
Public Class frmBudget
Inherits System.Windows.Forms.Form
Dim OleDbConnection As OleDb.OleDbConnection
.
.
Dim adExpences As OleDb.OleDbDataAdapter
Dim dsExpences As DataSet = New DataSet()
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myDate As String = dtpDate.Value
Dim myString As String
myString = (myDate)
myString = myString.Replace(".", "/")
Try
Me.OleDbConnection.Open()
dsExpences.Clear()
adExpences = New OleDb.OleDbDataAdapter("SELECT Sum(tblExpences.Amount) AS Total Expences from tblExpences where tblExpences.date1 = #" & myString & "#;", Me.OleDbConnection)
adExpences.Fill(dsExpences, "dtExpences")
llistboxAmount .DataSource = dsExpences.Tables("dtExpences")
Me.OleDbConnection.Close()
Catch ex As OleDb.OleDbException
MessageBox.Show(ex.Message)
End Try
end sub