Hi All
Im connecting to my SQL Server Stored Procedure and It requires a '@Parameter' to perform the 'Stored Procedure'. Im inputting the Parameter to 'Me.tbxSearch.Text' but doesnt seem to like it. Any ideas how I can sort this out?
Thanks
This is also the Stored Procedure CodeCode:CapitalVisasCRMDataSet.EnforceConstraints = False
Me.SpMainSearchTableAdapter.Fill(Me.CapitalVisasCRMDataSet.spMainSearch, Me.tbxSearch.Text)
Me.lsvSearchResults.Items.Clear()
Me.lsvSearchResults.BeginUpdate()
Dim spMainSearchRow As CapitalVisasCRMDataSet.spMainSearchRow
For Each spMainSearchRow In CapitalVisasCRMDataSet.spMainSearch.Rows
Dim reportListItem As New ListViewItem
reportListItem.Text = ""
reportListItem.SubItems.Add(spMainSearchRow("CaseID").ToString) ' Case ID
reportListItem.SubItems.Add(Microsoft.VisualBasic.StrConv(spMainSearchRow("Candidate"), VbStrConv.ProperCase).ToString) 'Candidate Name
reportListItem.SubItems.Add(spMainSearchRow("Email").ToString) 'Email Address
reportListItem.SubItems.Add(spMainSearchRow("Country").ToString) 'Country of Lead
reportListItem.SubItems.Add(spMainSearchRow("Nationality").ToString) 'Country of Nationality
reportListItem.SubItems.Add(spMainSearchRow.CustomerID) ' Customer ID
reportListItem.SubItems.Add(spMainSearchRow("CaseWorker").ToString) 'Caseworker
reportListItem.SubItems.Add(spMainSearchRow("Consultant").ToString) 'Consultant
lsvSearchResults.Items.Add(reportListItem)
Next
lsvSearchResults.EndUpdate()
spMainSearchRow = Nothing
Code:USE [CapitalVisasCRM]
GO
/****** Object: StoredProcedure [dbo].[spMainSearch] Script Date: 06/06/2010 13:38:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[spMainSearch]
@FilterText NVARCHAR(255)
AS
SELECT tblCases.CaseID, tblCases.Candidate, tblCases.Product, tblEmails.Email, tblCustomers.Nationality, tblCustomers.Country,
tblCompany.CompanyName AS [Company Name], tblCustomers.CustomerID, tblCases.Consultant, tblCases.CaseWorker
FROM tblCustomers LEFT OUTER JOIN
tblCases ON tblCustomers.CustomerID = tblCases.CustomerID LEFT OUTER JOIN
tblCompany ON tblCustomers.CustomerID = tblCompany.CustomerID LEFT OUTER JOIN
tblEmails ON tblCustomers.CustomerID = tblEmails.CustomerID
GROUP BY tblCustomers.Country, tblCustomers.Nationality, tblCustomers.CustomerID, tblCases.CaseID, tblCases.Product, tblCases.Consultant, tblCases.CaseWorker,
tblCases.Candidate, tblEmails.Email, tblCompany.CompanyName
HAVING (tblCustomers.Country = @FilterText) OR
(tblCustomers.Nationality = @FilterText) OR
(tblCustomers.CustomerID = @FilterText) OR
(tblCases.CaseID = @FilterText) OR
(tblCases.Product = @FilterText) OR
(tblCases.Consultant = @FilterText) OR
(tblCases.CaseWorker = @FilterText) OR
(tblCases.Candidate = @FilterText) OR
(tblEmails.Email = @FilterText) OR
(tblCompany.CompanyName = @FilterText)

