Special characters in DataView.RowFilter

212 views
Skip to first unread message

k.pradee...@googlemail.com

unread,
Feb 24, 2009, 4:26:27 AM2/24/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting

Hi all,

Suppose if I have the data like below.
SqlServer Table Emp:

EmpName Empno
--------------------------------------------------------
Kumar's p 123
bharat 124
pradeep'k kumar 125


I need to retrive only the 'kumar's p' related rows based on only
ename And needs to bind to the grid.
I am using dataview.rowfilter = "ename = 'kumar's p' . I am getting
the exception.

Please let me know how can I check this condition.

Thank you in advance.

Regards,
Pradeep



k.pradee...@googlemail.com

unread,
Feb 24, 2009, 4:36:03 AM2/24/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I am getting the following exception
----SynataxErrorException was unhandled by usercode
----Syntax error: Missing operand after 's' operator.


On Feb 24, 2:26 pm, "k.pradeep.kuma...@googlemail.com"

The_Fruitman

unread,
Feb 24, 2009, 9:46:39 AM2/24/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Look at the statement:
dataview.rowfilter = "ename = 'kumar's p'

Count the number of single quotes. What you're sending sending in the
program is reading as ename=kumar with extra information after kumar
that is causing the error. Try setting a variable to the value
kurmar's p and pass it in instead.



On Feb 24, 2:36 am, "k.pradeep.kuma...@googlemail.com"
> > Pradeep- Hide quoted text -
>
> - Show quoted text -

Cerebrus

unread,
Feb 24, 2009, 10:53:22 AM2/24/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Funny! Good catch, Fruitman ;-)

Raghupathi Kamuni

unread,
Feb 25, 2009, 8:26:33 AM2/25/09
to DotNetDe...@googlegroups.com

k.pradee...@googlemail.com

unread,
Feb 27, 2009, 6:07:17 AM2/27/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting

Thank you very much to all....

I was handle that by considering it as two substrings....

Thank you very much

On Feb 25, 6:26 pm, Raghupathi Kamuni <raghukam...@gmail.com> wrote:
> Good link for DataView.RowFilter expressions
>
> http://aspdotnetcodebook.blogspot.com/2008/07/short-tutorial-on-datav...
>
> On Tue, Feb 24, 2009 at 3:06 PM, k.pradeep.kuma...@googlemail.com <
>
>
>
> k.pradeep.kuma...@googlemail.com> wrote:
>
> > I am getting the following exception
> > ----SynataxErrorException was unhandled by usercode
> > ----Syntax error: Missing operand after 's' operator.
>
> > On Feb 24, 2:26 pm, "k.pradeep.kuma...@googlemail.com"
> >  <k.pradeep.kuma...@googlemail.com> wrote:
> > > Hi all,
>
> > > Suppose if I have the data like below.
> > > SqlServer Table Emp:
>
> > >  EmpName                            Empno
> > > --------------------------------------------------------
> > >  Kumar's p                             123
> > >  bharat                                   124
> > >  pradeep'k kumar                    125
>
> > > I need to retrive only the 'kumar's p' related rows based on only
> > > ename And needs to bind to the grid.
> > > I am using dataview.rowfilter = "ename = 'kumar's p' . I am getting
> > > the exception.
>
> > > Please let me know how can I check this condition.
>
> > > Thank you in advance.
>
> > > Regards,
Reply all
Reply to author
Forward
0 new messages