Click here to Skip to main content
16,020,186 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Private Sub Admissionrecord_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'ButhdatabaseDataSet.Admission' table. You can move, or remove it, as needed.
OpenConnection()
Dim da As OleDbDataAdapter
Dim dt As DataTable
da = New OleDbDataAdapter("SELECT Hospital No,Patient's Name,Date Attended,Reffered By,Consultant,Ward,Date Discharged,Discharged To,Condition On Discharge,Discharge Summary FROM Admission", Connection)
dt = New DataTable
da.Fill(dt)
AdmissionDataGridView.DataSource = dt
AdmissionDataGridView.Refresh()
Connection.Close()
da.Dispose()

What I have tried:

please kindly help me with this. thank you
Posted
Updated 21-Sep-17 22:21pm

1 solution

Spaces, my friend, spaces:
Change this:
SQL
SELECT Hospital No,Patient's Name,Date Attended,Reffered By,Consultant,Ward,Date Discharged,Discharged To,Condition On Discharge,Discharge Summary FROM Admission
To this:
SQL
SELECT [Hospital No],[Patient's Name],[Date Attended],[Reffered By],[Consultant],[Ward],[Date Discharged],[Discharged To],[Condition On Discharge],[Discharge Summary] FROM Admission
And remove the quote character from the column name as well...
 
Share this answer
 
Comments
Member 13341316 22-Sep-17 5:11am    
Thank you so much God bless you
OriginalGriff 22-Sep-17 5:22am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900