|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Perform a LIKE filter on DataView Integer column?Don't know if this can be done, but if I have a DataTable/DataView that has
an integer column. Is there a way to do a "LIKE '123%'" kind of a filter on the column, which obviously works for text a text column. Thanks. Is this what you are looking for?
where cast(id as varchar) like 123%' -- Show quoteHide quoteBrad "Software is like melted pudding..." "Chris Botha" wrote: > Don't know if this can be done, but if I have a DataTable/DataView that has > an integer column. > Is there a way to do a "LIKE '123%'" kind of a filter on the column, which > obviously works for text a text column. > > Thanks. > > > Hi Brad, thanks, but no, I want to set the RowFilter property of the
DataView. I gave your idea a shot, but "CAST" is not valid in the RowFilter :-( Thanks in any case.Show quoteHide quote "Brad Roberts" <BradRoberts56noj***@hotmail.com> wrote in message news:277B6C0D-5576-401C-B4C1-9A9F79AA2637@microsoft.com... > Is this what you are looking for? > > where cast(id as varchar) like 123%' > -- > Brad > > "Software is like melted pudding..." > > > "Chris Botha" wrote: > >> Don't know if this can be done, but if I have a DataTable/DataView that >> has >> an integer column. >> Is there a way to do a "LIKE '123%'" kind of a filter on the column, >> which >> obviously works for text a text column. >> >> Thanks. >> >> >> Chris,
| DataView. I gave your idea a shot, but "CAST" is not valid in the "CAST" is not valid, however CONVERT should be valid.RowFilter http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.80).aspx I haven't tried it, but something like: Dim filter As String = "convert(id, 'System.String') like '123%'" -- Show quoteHide quoteHope this helps Jay [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Chris Botha" <chris_s_both***@hotmail.com> wrote in message news:%238W%23gfqUGHA.5652@TK2MSFTNGP09.phx.gbl... | Hi Brad, thanks, but no, I want to set the RowFilter property of the | DataView. I gave your idea a shot, but "CAST" is not valid in the RowFilter | :-( | | Thanks in any case. | | | "Brad Roberts" <BradRoberts56noj***@hotmail.com> wrote in message | news:277B6C0D-5576-401C-B4C1-9A9F79AA2637@microsoft.com... | > Is this what you are looking for? | > | > where cast(id as varchar) like 123%' | > -- | > Brad | > | > "Software is like melted pudding..." | > | > | > "Chris Botha" wrote: | > | >> Don't know if this can be done, but if I have a DataTable/DataView that | >> has | >> an integer column. | >> Is there a way to do a "LIKE '123%'" kind of a filter on the column, | >> which | >> obviously works for text a text column. | >> | >> Thanks. | >> | >> | >> | | Hi Jay, works perfectly, thanks a lot ! :-)
Show quoteHide quote "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in message news:e$87xwuUGHA.4660@tk2msftngp13.phx.gbl... > Chris, > | DataView. I gave your idea a shot, but "CAST" is not valid in the > RowFilter > "CAST" is not valid, however CONVERT should be valid. > > http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.80).aspx > > I haven't tried it, but something like: > > Dim filter As String = "convert(id, 'System.String') like '123%'" > > -- > Hope this helps > Jay [MVP - Outlook] > .NET Application Architect, Enthusiast, & Evangelist > T.S. Bradley - http://www.tsbradley.net > > > "Chris Botha" <chris_s_both***@hotmail.com> wrote in message > news:%238W%23gfqUGHA.5652@TK2MSFTNGP09.phx.gbl... > | Hi Brad, thanks, but no, I want to set the RowFilter property of the > | DataView. I gave your idea a shot, but "CAST" is not valid in the > RowFilter > | :-( > | > | Thanks in any case. > | > | > | "Brad Roberts" <BradRoberts56noj***@hotmail.com> wrote in message > | news:277B6C0D-5576-401C-B4C1-9A9F79AA2637@microsoft.com... > | > Is this what you are looking for? > | > > | > where cast(id as varchar) like 123%' > | > -- > | > Brad > | > > | > "Software is like melted pudding..." > | > > | > > | > "Chris Botha" wrote: > | > > | >> Don't know if this can be done, but if I have a DataTable/DataView > that > | >> has > | >> an integer column. > | >> Is there a way to do a "LIKE '123%'" kind of a filter on the column, > | >> which > | >> obviously works for text a text column. > | >> > | >> Thanks. > | >> > | >> > | >> > | > | > >
Form Exit
Class question VB.NET Threaded DLL Update an Access DB using VB.Net VB 2005 .net- Login control - how do I validate user no / password against SQL server multitier app set default printer IntelliSense Code Comments? Problem converting to VS2005 - No SUB MAIN found! Using VB 2005 assemblies with VB 2003 |
|||||||||||||||||||||||