Click here to Skip to main content
15,887,477 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Variables Naming Pin
Jon_Boy12-Feb-09 7:48
Jon_Boy12-Feb-09 7:48 
GeneralRe: Variables Naming Pin
Samir Ibrahim12-Feb-09 9:45
Samir Ibrahim12-Feb-09 9:45 
QuestionCrystal report problem Pin
mahalakshmi4211-Feb-09 19:54
mahalakshmi4211-Feb-09 19:54 
QuestionHow to apply Read lock to Record in VB 6.0 Pin
Jhanvy Thaker11-Feb-09 18:45
Jhanvy Thaker11-Feb-09 18:45 
AnswerRe: How to apply Read lock to Record in VB 6.0 Pin
Vimalsoft(Pty) Ltd11-Feb-09 22:47
professionalVimalsoft(Pty) Ltd11-Feb-09 22:47 
AnswerRe: How to apply Read lock to Record in VB 6.0 Pin
Prasadsm11-Feb-09 23:02
Prasadsm11-Feb-09 23:02 
AnswerRe: How to apply Read lock to Record in VB 6.0 Pin
Dave Kreskowiak12-Feb-09 1:42
mveDave Kreskowiak12-Feb-09 1:42 
QuestionFilter percent (%) and apostrophes (') contained in a string Pin
mbv80011-Feb-09 16:54
mbv80011-Feb-09 16:54 
I am trying to filter fields in a table that contain percent (%) and apostrophe (') characters. I kow that to filter an apostrophe you need to add another apostrophe (''). However, when a text contains the percent (%) character in combination with an apostrophe (') character, an exception is thrown. Also, when using the % character in a filter string, it will be function as an "*" (fields starting or ending with). I need the % to be considered as a character whenever the % makes part of a string in the field. How can I address these issues?

The code below explains my question.

Dim TheTable As New DataTable
Dim col As New DataColumn("Col1")
TheTable.Columns.Add(col)
Dim TheRow As DataRow = TheTable.NewRow
TheRow("Col1") = "Filter me"
TheTable.Rows.Add(TheRow)
TheRow = TheTable.NewRow
TheRow("Col1") = "Filter me%"
TheTable.Rows.Add(TheRow)
TheRow = TheTable.NewRow
TheRow("Col1") = "Filter me'"
TheTable.Rows.Add(TheRow)
TheRow = TheTable.NewRow
TheRow("Col1") = "Filter me%'"
TheTable.Rows.Add(TheRow)
TheRow = TheTable.NewRow
Dim filteredrows() As DataRow

filteredrows = TheTable.Select("Col1 Like 'Filter me'")
MsgBox(filteredrows.Length)

'THE NEXT LINE WILL RETURN ALL RECORDS. I NEED ONLY THE RECORD ENDING WITH (OR CONTAINING) THE CHARACTER %
filteredrows = TheTable.Select("Col1 Like 'Filter me%'")
MsgBox(filteredrows.Length)

'THE NEXT LINE WILL RETURN TWO RECORDS (Filter me) and (Filter me'). I need it to return (Filter me') only
filteredrows = TheTable.Select("Col1 Like 'Filter me'''")
MsgBox(filteredrows.Length)

'THE NEXT LINE WILL THROW AND ERROR: "Error in Like operator: the string pattern 'Filter me%'' is invalid"
filteredrows = TheTable.Select("Col1 Like 'Filter me%'''")
MsgBox(filteredrows.Length)
AnswerRe: Filter percent (%) and apostrophes (') contained in a string Pin
paas12-Feb-09 1:06
paas12-Feb-09 1:06 
AnswerRe: Filter percent (%) and apostrophes (') contained in a string Pin
Guffa12-Feb-09 1:33
Guffa12-Feb-09 1:33 
QuestionRubber Banding in VB 2008 Pin
StefanGeorgiev11-Feb-09 16:45
StefanGeorgiev11-Feb-09 16:45 
AnswerRe: Rubber Banding in VB 2008 Pin
Ranjit Viswakumar11-Feb-09 17:29
Ranjit Viswakumar11-Feb-09 17:29 
GeneralRe: Rubber Banding in VB 2008 Pin
Guffa12-Feb-09 1:41
Guffa12-Feb-09 1:41 
AnswerRe: Rubber Banding in VB 2008 Pin
Guffa12-Feb-09 1:39
Guffa12-Feb-09 1:39 
QuestionAdding web-address to menustrip and access from there. Pin
Gagan.2011-Feb-09 16:26
Gagan.2011-Feb-09 16:26 
AnswerRe: Adding web-address to menustrip and access from there. Pin
Dave Kreskowiak13-Feb-09 3:42
mveDave Kreskowiak13-Feb-09 3:42 
Questiongrouping subroutines Pin
Duane195811-Feb-09 15:58
Duane195811-Feb-09 15:58 
GeneralRe: grouping subroutines Pin
Luc Pattyn11-Feb-09 16:32
sitebuilderLuc Pattyn11-Feb-09 16:32 
GeneralRe: grouping subroutines Pin
Duane195811-Feb-09 16:55
Duane195811-Feb-09 16:55 
QuestionWorking with Active Directory in VB.NET Pin
sdavis8811-Feb-09 14:23
sdavis8811-Feb-09 14:23 
AnswerRe: Working with Active Directory in VB.NET Pin
Dave Kreskowiak13-Feb-09 3:43
mveDave Kreskowiak13-Feb-09 3:43 
QuestionInitialize array parameter? Pin
craigmg7811-Feb-09 10:56
craigmg7811-Feb-09 10:56 
AnswerRe: Initialize array parameter? Pin
Dave Kreskowiak11-Feb-09 14:11
mveDave Kreskowiak11-Feb-09 14:11 
GeneralRe: Initialize array parameter? Pin
Luc Pattyn11-Feb-09 14:38
sitebuilderLuc Pattyn11-Feb-09 14:38 
GeneralRe: Initialize array parameter? Pin
craigmg7812-Feb-09 4:41
craigmg7812-Feb-09 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.