G
Guest
I have confirmed that the following SQL string works in Access:
SELECT[MRN],[MemNAME],[DOB],[SEX],[SSN],[GROUP],[SGR],[FROM-DT],[THRU-DT]FROM MEMBERSHIP WHERE [MemName] like 'duld*';
I have also confirmed that it is successfully passed as a Public String
into strMemberSQL
So why won't it successfully open my datagrid in this code?
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
dcMalpha.Open()
'Set the new adapter with the appropriate SQL string from above
Dim daMembers As New OleDb.OleDbDataAdapter
daMembers.SelectCommand = New OleDb.OleDbCommand(strMemberSQL,
dcMalpha)
Me.lblSQL.Text = strMemberSQL
Dim dsMembers As New DataSet
daMembers.Fill(dsMembers, "Membership")
dcMalpha.Close()
DGMembers.DataSource = dsMembers.Tables("Membership")
DGMembers.DataBind()
End Sub
SELECT[MRN],[MemNAME],[DOB],[SEX],[SSN],[GROUP],[SGR],[FROM-DT],[THRU-DT]FROM MEMBERSHIP WHERE [MemName] like 'duld*';
I have also confirmed that it is successfully passed as a Public String
into strMemberSQL
So why won't it successfully open my datagrid in this code?
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
dcMalpha.Open()
'Set the new adapter with the appropriate SQL string from above
Dim daMembers As New OleDb.OleDbDataAdapter
daMembers.SelectCommand = New OleDb.OleDbCommand(strMemberSQL,
dcMalpha)
Me.lblSQL.Text = strMemberSQL
Dim dsMembers As New DataSet
daMembers.Fill(dsMembers, "Membership")
dcMalpha.Close()
DGMembers.DataSource = dsMembers.Tables("Membership")
DGMembers.DataBind()
End Sub