C
Cindy H
Hi
I'm not getting any data back on this code.
Can someone tell me what I'm doing wrong?
What I really want is to select fields out of two table where the display
= 'y' from both tables and in one table the email is = to variable I'm
passing.
Public Shared Function GetSelectedProgressReport(ByVal Email As String) As
DataSet
Dim dsCustProg As New DataSet
Dim cmdCustProg As New OleDbCommand
Dim cSelect As String = "SELECT * FROM ConstructionCustomers WHERE Display =
'y' and Email = @Email"
Dim pSelect As String = "SELECT * FROM ConstructionProgress WHERE Display =
'y'"
cmdCustProg.CommandText = cSelect
cmdCustProg.CommandText = pSelect
' Add Parameters to cmd
Dim parameterEmail As OleDbParameter = New OleDbParameter("@Email",
OleDbType.VarChar, 100)
parameterEmail.Value = Email
cmdCustProg.Parameters.Add(parameterEmail)
cmdCustProg.Connection = MyConnection()
Dim daCustomer As New OleDbDataAdapter
Dim daProgress As New OleDbDataAdapter
daCustomer.SelectCommand = cmdCustProg
daProgress.SelectCommand = cmdCustProg
daCustomer.Fill(dsCustProg, "ConstructionCustomers")
daProgress.Fill(dsCustProg, "ConstructionProgress")
Dim relation As DataRelation = _
dsCustProg.Relations.Add("CustProg", _
dsCustProg.Tables("ConstructionCustomers").Columns("CustomerID"), _
dsCustProg.Tables("ConstructionProgress").Columns("CustomerID"))
Return dsCustProg
End Function
Thanks,
CindyH
I'm not getting any data back on this code.
Can someone tell me what I'm doing wrong?
What I really want is to select fields out of two table where the display
= 'y' from both tables and in one table the email is = to variable I'm
passing.
Public Shared Function GetSelectedProgressReport(ByVal Email As String) As
DataSet
Dim dsCustProg As New DataSet
Dim cmdCustProg As New OleDbCommand
Dim cSelect As String = "SELECT * FROM ConstructionCustomers WHERE Display =
'y' and Email = @Email"
Dim pSelect As String = "SELECT * FROM ConstructionProgress WHERE Display =
'y'"
cmdCustProg.CommandText = cSelect
cmdCustProg.CommandText = pSelect
' Add Parameters to cmd
Dim parameterEmail As OleDbParameter = New OleDbParameter("@Email",
OleDbType.VarChar, 100)
parameterEmail.Value = Email
cmdCustProg.Parameters.Add(parameterEmail)
cmdCustProg.Connection = MyConnection()
Dim daCustomer As New OleDbDataAdapter
Dim daProgress As New OleDbDataAdapter
daCustomer.SelectCommand = cmdCustProg
daProgress.SelectCommand = cmdCustProg
daCustomer.Fill(dsCustProg, "ConstructionCustomers")
daProgress.Fill(dsCustProg, "ConstructionProgress")
Dim relation As DataRelation = _
dsCustProg.Relations.Add("CustProg", _
dsCustProg.Tables("ConstructionCustomers").Columns("CustomerID"), _
dsCustProg.Tables("ConstructionProgress").Columns("CustomerID"))
Return dsCustProg
End Function
Thanks,
CindyH