Hi,
The Background
I'm working on a Bible searching application, and I have a DataTable with a whole lot of verses in it that I'm wanting to search. So I'm using a DataView with a RowFilter to search through the text to return rows with a particular word. A sample of the code is as follows:
The Problem
The trouble is that if I search for a text such as amazing then it won't retrieve amazing. or amazing! - the punctuation keeps mucking up the return results.
Is there any way to fix this, or is there a better way to approach this?
Thanks,
Peter
The Background
I'm working on a Bible searching application, and I have a DataTable with a whole lot of verses in it that I'm wanting to search. So I'm using a DataView with a RowFilter to search through the text to return rows with a particular word. A sample of the code is as follows:
Code:
public int SearchVerses(string searchtext) { searchtext = searchtext.Replace("'","\\'"); ArrayList verselist = new ArrayList(); string verseid=""; string selecttext = "VerseText LIKE '%" + searchtext + "%'"; DataTable dtverselist = bereanmain.res.GetCurrentVerseList; DataView dvverselist = new DataView(dtverselist,selecttext,"VerseID",DataViewRowState.CurrentRows); foreach (DataRowView drv in dvverselist) { verseid = drv[0].ToString(); verselist.Add(verseid); }
The trouble is that if I search for a text such as amazing then it won't retrieve amazing. or amazing! - the punctuation keeps mucking up the return results.
Is there any way to fix this, or is there a better way to approach this?
Thanks,
Peter
Comment