VS 2008 Unable To Do A Case-insensitive Query On A Table?
Jul 13, 2009
I'm having trouble when trying to do a case-insensitive query on a table. Right now the query is:
txtQuery = "SELECT Status, RankingSearchEngines FROM [tbl-DATA-Client-Keywords] WHERE [Client-ID-Code] = '" & clientNo & "' AND lower(Keyword) LIKE '" & sField(0) & "';"
The actual query executed is:
SELECT Status, RankingSearchEngines FROM [tbl-DATA-Client-Keywords] WHERE [Client-ID-Code] = '1402' AND lower(Keyword) LIKE 'flyer printing';
I have an entry 'Flyer Printing' in the database, and this query works perfectly without the case-insensitive check.I'm not sure if this is an OleDB issue, as I've never had this sort of problem with SQLPlus, or anything else
The exception being thrown is:
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
I am using the contains method to look through an array to find matches, however I notice that when I use it it is case sensitive. Is there another method I can use to do a case insensitive search or some way to modify the contains method to search case insensitively? [code]
I am using this code to get a list of files in a folder:
Dim files() As String = (From file In New IO.DirectoryInfo(myFolder).GetFiles Where file.Extension = ".exe" Select file.Name).ToArray
This works fine, but the problem is that it selects only files with the extension of "exe" & skips files that have an "EXE" extension. Is there any way to make it case-insensitive, to make it return any combination of upper/lower case letters in the extension?
I dislike WPF's inability to interpret text in a case-insensitive way.Are there any tools (i.e. VS plugins) out there that will take my VB .NET code and handle the case-sensitivity issues for me?Edit: Now with examples.
visual basic.net is case insensitive so it allows the coder to write without caring or remembering the casing of variables. it also relieves from the 'undeclared variable' errors if you use the variable in another case than the one used in declaration. The fact that its line termination is a line feed makes it even more readable unlike C# or c++ that need good care in the casing and contineous war with following up with the {}, matching them and figuring out which is for which.
my question is what are the advantages of c# over vb knowing that both get compiled to MSIL so there is almost no performance difference between the two languages?
I created a Web Reference (also tried Service Reference) to a WSDL that had the following node inside an xsd: <xs:element name="filter"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element minOccurs="0" maxOccurs="unbounded" ref="condition" /> <xs:element minOccurs="0" maxOccurs="unbounded" ref="filter" /> [Code] .....
This wouldn't build in a VB project because VB.NET is case insensitive. I tried deleting one set of and/or, but when the XML is created, it simply ignores the selected value. I also tried appending an X at the end of one the sets which also failed. Is there a way to make this work? I also tried updating the XSD so it just had two values without success. The interesting thing to note is that default is set to "and" and while debugging it will set it to and, it doesn't actually produce the node attribute of it just generates.
I have a TextBox that need to be case-insensitive. For example, I have this. If searchTextBox.Text = "Park" Then... I need results back if "Park" is typed or "park".
I put this at the top of my project: Option Compare Text
Here is the sub that contains the process name check: Sub AC3() Dim ProcessList As System.Diagnostics.Process() ProcessList = System.Diagnostics.Process.GetProcesses() Dim Proc As System.Diagnostics.Process For Each Proc In ProcessList [Code] .....
No errors, but it only checks the lowercase hack/cheat/inject. I need it to be case insensitive when checking it.
Figured it out and tested and it works. I put, right after dim procname... procname = procname.ToLower() works great.
I've read that it's unwise to use ToUpper and ToLower to perform case-insensitive string comparisons, but I see no alternative when it comes to LINQ-to-SQL. The ignoreCase and CompareOptions arguments of String.Compare are ignored by LINQ-to-SQL (if you're using a case-sensitive database, you get a case-sensitive comparison even if you ask for a case-insensitive comparison). Is ToLower or ToUpper the best option here? Is one better than the other? I thought I read somewhere that ToUpper was better, but I don't know if that applies here. (I'm doing a lot of code reviews and everyone is using ToLower.)
I am working on a program for a client and will need a feature to search for strings from an array without case sensitivity. This currently works, but it is case sensitive. I commented out the code for readability.
' Declare array for goldSmithingExpertise and add items. Dim goldsmithingExpertise() As String = {"Alluring Earrings", "Alluring Ring", "Alluring Belt", "Howling Staff", "Dawn Ring", _ "Melancholy Earrings", "Melancholy Belt", "Melancholy Ring", "Jubilant Ring", "Jubilant Earrings", _
I've been using text.indexof() to see if a string is located inside another string, however is it it possible to do a case sensitive/insensitive search option? I've been looking around Google and not having much luck with it.
A huge bonus would be if it could count the number of occurrences inside the string!
I am searching through files and only want to include files with certain extensions. Right now I have what is below but it would be stupid to do it that way for 3 or more file types and it isn't completely case insensitive.
If ext = ".jpg" Or ext = ".JPG" Then
I want to check for .jpg .gif .png all case insensitive.
I've recently learnt that Regex class maybe used to develop case insensitive searches. I have a registry search program that will return only the exact matches from the registry. I need to make it case insensitive. how to do that using regular expressions in vb.net 2005. Im posting my code below:
Sub SearchSubKeys(ByVal root As RegistryKey, ByVal searchKey As String) Dim matchtype As String = Nothing Dim str(5) As String
visual basic.net is case insensitive so it allows the coder to write without caring or remembering the casing of variables. it also relieves from the 'undeclared variable' errors if you use the variable in another case than the one used in declaration. The fact that its line termination is a line feed makes it even more readable unlike C# or c++ that need good care in the casing and contineous war with following up with the {}, matching them and figuring out which is for which.my question is what are the advantages of c# over vb knowing that both get compiled to MSIL so there is almost no performance difference between the two languages?
I'm using a DataGridView to post the results of LINQ-from-SQL query. I was hoping that the data would be editable in the DataGridView, but it isn't. I made sure that DataGridView.readonly = false. I'm using VB.
VB 2008 DB = New CXToolDataContext() Dim Systems = (From TBLSYSTEMS In DB.tblSystems, TBLSYSTYPES In DB.tblSystemTypes _ Where TBLSYSTEMS.ProjectName = projectnumber And TBLSYSTEMS.SystemType =
Dim subtotal As Decimal = CDec(txtSubtotal.Text) Dim discountPercent As Decimal Select Case txtCustomerType.Text.ToUpper() = "R" Case CBool(250) To CBool(500) discountPercent = 0.25D
I have problem with select case statement. When I click the button, nothing have happens.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim google As String Select Case google Case 0
with vb.net 2008 express + access 2003;how can i query Msysobject table because presently i am getting error message as " no read permission on system objects"/i want to query it because just to ensure that whether a table by name "tableX:" exists or not
I am working in VB.NET08 I was created Crosstab for table called 'Crosstabtemp' as given below:
Crosstabtemp= CrossTab(tblB, "PersonID", "ContactMedium", "ContactNumber", "Personal_") I was declared Crosstabtemp as a Datatable in my above code. I want to use the Crosstabtemp in my further sql query. I need to join few Db tables with this Crosstabtemp??
An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dllerror in line: dbAdp.Update(dbDset) in btnSave_Click, (elseif editflag = true) blockdescription: Update unable to find TableMapping['Table'] or DataTable 'Table'I was also wondering if I could simply use the ExecuteNonQuery for the delete statement, but since I've placed my data in a datarow, I'm not sure if i can actually use it. Any thoughts on this? Btw, this is my first time using a datarow, and I've recently been studying how to use ADO.net.
dr = dbDset.Tables(0).Rows(CurIndex) dr.Delete() dbAdp.Update(dbDset.Tables("addresses"))
I have a table adaptor that pulls from the sql database, when I edit the table adaptor query it makes this specific table adaptor not a part of the dataset. I have added a column to my database which will contain an integer, when I try to add this column to the query this error occurs, i am using the configure area of the table adaptor. Error 'AuditProductsTableAdapter' is not a member of 'MemKingClient.MemKingDataSetTableAdapters.TableAdapterManager'.