Here is the code for the stored proc:
CREATE PROCEDURE
dbo.Talisma_Search
(@Talisma_Search NVARCHAR(255))
AS
SELECT
[dbo].[tblTalisma_Lookup].[tName]
, [dbo].[tblTalisma_Lookup].[tSSN]
, [dbo].[tblTalisma_Lookup].[tEmail]
FROM
[dbo].[tblTalisma_Lookup]
WHERE
[dbo].[tblTalisma_Lookup].[tName] LIKE '%'+@Talisma_Search + '%'
OR [dbo].[tblTalisma_Lookup].[tSSN] LIKE '%'+@Talisma_Search + '%'
OR [dbo].[tblTalisma_Lookup].[tEmail] LIKE '%'+@Talisma_Search + '%'
ORDER BY
Here is the code to execute the stored proc but the name in single quotes will need to change each time:
EXEC dbo.talisma_Search @talisma_Search ='savage'
Here is the code I have on the Visual Studio Windows Form right now:
private voidLoadData(Int32 Talisma_Search)
{
SqlConnection conn = newSqlConnection("DataSource='talismadb';Initial Catalog=tlMain;Integrated Security=True");
// change this connection string according to you settingsof sql server
SqlCommand cmd = new SqlCommand("dbo.Talisma_Search",
conn);
cmd.CommandText = "Talisma_Search"; cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Talisma_Search", Talisma_Search);
SqlDataAdapter adapter = newSqlDataAdapter(cmd);
DataSet dataSet1 = newDataSet(); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table");