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 GetSelectedProg ressReport(ByVa l Email As String) As
DataSet
Dim dsCustProg As New DataSet
Dim cmdCustProg As New OleDbCommand
Dim cSelect As String = "SELECT * FROM ConstructionCus tomers WHERE Display =
'y' and Email = @Email"
Dim pSelect As String = "SELECT * FROM ConstructionPro gress WHERE Display =
'y'"
cmdCustProg.Com mandText = cSelect
cmdCustProg.Com mandText = pSelect
' Add Parameters to cmd
Dim parameterEmail As OleDbParameter = New OleDbParameter( "@Email",
OleDbType.VarCh ar, 100)
parameterEmail. Value = Email
cmdCustProg.Par ameters.Add(par ameterEmail)
cmdCustProg.Con nection = MyConnection()
Dim daCustomer As New OleDbDataAdapte r
Dim daProgress As New OleDbDataAdapte r
daCustomer.Sele ctCommand = cmdCustProg
daProgress.Sele ctCommand = cmdCustProg
daCustomer.Fill (dsCustProg, "ConstructionCu stomers")
daProgress.Fill (dsCustProg, "ConstructionPr ogress")
Dim relation As DataRelation = _
dsCustProg.Rela tions.Add("Cust Prog", _
dsCustProg.Tabl es("Constructio nCustomers").Co lumns("Customer ID"), _
dsCustProg.Tabl es("Constructio nProgress").Col umns("CustomerI D"))
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 GetSelectedProg ressReport(ByVa l Email As String) As
DataSet
Dim dsCustProg As New DataSet
Dim cmdCustProg As New OleDbCommand
Dim cSelect As String = "SELECT * FROM ConstructionCus tomers WHERE Display =
'y' and Email = @Email"
Dim pSelect As String = "SELECT * FROM ConstructionPro gress WHERE Display =
'y'"
cmdCustProg.Com mandText = cSelect
cmdCustProg.Com mandText = pSelect
' Add Parameters to cmd
Dim parameterEmail As OleDbParameter = New OleDbParameter( "@Email",
OleDbType.VarCh ar, 100)
parameterEmail. Value = Email
cmdCustProg.Par ameters.Add(par ameterEmail)
cmdCustProg.Con nection = MyConnection()
Dim daCustomer As New OleDbDataAdapte r
Dim daProgress As New OleDbDataAdapte r
daCustomer.Sele ctCommand = cmdCustProg
daProgress.Sele ctCommand = cmdCustProg
daCustomer.Fill (dsCustProg, "ConstructionCu stomers")
daProgress.Fill (dsCustProg, "ConstructionPr ogress")
Dim relation As DataRelation = _
dsCustProg.Rela tions.Add("Cust Prog", _
dsCustProg.Tabl es("Constructio nCustomers").Co lumns("Customer ID"), _
dsCustProg.Tabl es("Constructio nProgress").Col umns("CustomerI D"))
Return dsCustProg
End Function
Thanks,
CindyH
Comment