Hi,
Ive got the code working to an extent when comparing the searchterm with an column name, but there is still 2 problems Im having.
Initially the LIKE isnt working, Infact if I even enter nothing it brings up any record seeming to me that something is wrong somewhere, could this be the database (access xp???)
Secondly, reminding all those reading im a newbie, how do I apply concatenation as Ive been told this is what I need to use
Basically I want a drop down list which the user then selects the field to search i.e. nmno, pcsn etc. Then a 2nd box to type in a term to compare the contents to.
I.e. box 1.select ->Location. Box 2. type ward...........etc. Here my current semi-working query.
objCmd = new OleDbCommand("SELECT asset.*, pcdata.*"+
"FROM asset INNER JOIN pcdata ON asset.pcsn=pcdata.pcsn WHERE @seachtype LIKE @searchterm", objConn);
objCmd.Parameters.Add("@searchtype", ddlType.SelectedItem.Value);
objCmd.Parameters.Add("@searchterm", "%" + txtSearch.Text + "%");
I really appreciate all the help guys, If you can point me in the direction of a tutorial or something or maybe suggest what I may be im sure I can work it out.