I'm working with a dataset table populated with people name which contains
"'" and "%" symbols. How can i filter my table with Select method? These
symbols aren't supported by a simple string like
string name = "Francesc'one";
DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name +
"'"); 7 25429
hi ,
maybe its gonna help you
string t =dt.DefaultView.Sort.Substring(1);
t=t.Substring(0,t.LastIndexOf("]")) ;
dt.DefaultView.RowFilter = t + " LIKE '" + txtSearch.Text + "%'" ;
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'");
hi ,
maybe its gonna help you
string t =dt.DefaultView.Sort.Substring(1);
t=t.Substring(0,t.LastIndexOf("]")) ;
dt.DefaultView.RowFilter = t + " LIKE '" + txtSearch.Text + "%'" ;
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'");
Sorry, i don't understand how to use your suggestion. Could you tell me more,
please? :)
"Hasan O" wrote: hi , maybe its gonna help you string t =dt.DefaultView.Sort.Substring(1);
t=t.Substring(0,t.LastIndexOf("]")) ;
dt.DefaultView.RowFilter = t + " LIKE '" + txtSearch.Text + "%'" ;
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'");
Sorry, i don't understand how to use your suggestion. Could you tell me more,
please? :)
"Hasan O" wrote: hi , maybe its gonna help you string t =dt.DefaultView.Sort.Substring(1);
t=t.Substring(0,t.LastIndexOf("]")) ;
dt.DefaultView.RowFilter = t + " LIKE '" + txtSearch.Text + "%'" ;
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'");
Use the escape syntax,
string SelectStr = "Hello Forum\'s";
to make Hello Forum's
Does this help ?
"TastoEsc" wrote: Sorry, i don't understand how to use your suggestion. Could you tell me more, please? :)
"Hasan O" wrote:
hi , maybe its gonna help you string t =dt.DefaultView.Sort.Substring(1);
t=t.Substring(0,t.LastIndexOf("]")) ;
dt.DefaultView.RowFilter = t + " LIKE '" + txtSearch.Text + "%'" ;
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'");
Use the escape syntax,
string SelectStr = "Hello Forum\'s";
to make Hello Forum's
Does this help ?
"TastoEsc" wrote: Sorry, i don't understand how to use your suggestion. Could you tell me more, please? :)
"Hasan O" wrote:
hi , maybe its gonna help you string t =dt.DefaultView.Sort.Substring(1);
t=t.Substring(0,t.LastIndexOf("]")) ;
dt.DefaultView.RowFilter = t + " LIKE '" + txtSearch.Text + "%'" ;
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'");
Hi,
Straight out of DataColumn.Expression help topic:
" If the string in a LIKE clause contains a * or %, those characters should
be escaped in brackets ([]). "
--
Miha Markic [MVP C#] - RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info
"TastoEsc" <Ta******@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com... I'm working with a dataset table populated with people name which contains "'" and "%" symbols. How can i filter my table with Select method? These symbols aren't supported by a simple string like
string name = "Francesc'one"; DataRow[] filteredRows = ds.Tables["Contacts"].Select("Name = '" + name + "'"); This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Antonio Ooi |
last post by:
Hi,
I get a DataTable based on this simple query:
SELECT * FROM Customers
Later, I want to know just the table name because I do not want to play with
the string within the SELECT statement....
|
by: beta |
last post by:
Hello everyone,
I need some help here. If anyone has encountered this, knidly give me
your advice.
I have a command button (Command0) and a listbox (List1). Upon
clicking the command button,...
|
by: Derrick |
last post by:
or is there some other MaxRows type of prop so you can limit result set?
Thanks in advance!
Derrick
|
by: TastoEsc |
last post by:
I'm working with a dataset table populated with people name which contains
"'" and "%" symbols. How can i filter my table with Select method? These
symbols aren't supported by a simple string like...
|
by: Reney |
last post by:
I am using Access Database in my program. The column in the table that I am
going to use has date/time value with Medium Time selected. (HH:mm). The
program is recording a clock in time to this...
|
by: Alex Maghen |
last post by:
I have some client-side JavaScript that I want to run whenever a pulldown
<SELECT> is changes on th client. I'm trying to do this as follows...
<select id="MyPulldown"...
|
by: slinky |
last post by:
I'm getting a error when I open my . aspx in my browser... line 34:
da.Fill(ds, "Assets")
Here's the error and my entire code for this .aspx.vb is below
that ...
I need some clues as to what is...
|
by: gggram2000 |
last post by:
//When cbxInvNum is changed, it will display all fields on dgDisplay datagrid from SaleReceipts Table where invoice number = to the selected invoice number
string sql = "SELECT * WHERE InvoiceNumber...
|
by: Mitzvetsia |
last post by:
I'm trying to allow database users to click on a button on a form and send e-mail to certain clients based on what criteria they select from a drop-down box on said form.
The send e-mail function...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |