Re: DataTable.select problem with variables

Tech-Archive recommends: Fix windows errors by optimizing your registry



On May 1, 12:02 pm, "Jon Skeet [C# MVP]" <s...@xxxxxxxxx> wrote:
On May 1, 11:50 am, Manikandan <plmanikan...@xxxxxxxxx> wrote:

<snip>

I'm actually taking the values from database(sql server) and using in
select statement.
For demonstration only i used above code, is there any chance of
problem from sql server 2000

Possibly - it's hard to know for sure.

Could you post a short but complete program which demonstrates the
problem?
Seehttp://pobox.com/~skeet/csharp/complete.htmlfor more details.

Jon


Hi,
Thanks Jon
I found the mistake after adding the single quotes i gave a space and
then double quotes, while debugging it doesn't show the space(unable
to find the space while debugging, so i think it was correct)

mistaken one
string qry="s1= ' " + v1 + " ' AND s2=' " + v2 + " '" ;
Correct one
string qry="s1= '" + v1 + "' AND s2='" + v2 + "'" ;

Thank You,
Regards,
Mani


.



Relevant Pages

  • Re: DataTable.select problem with variables
    ... We have ways of parameterizing queries ... I found the mistake after adding the single quotes i gave a space and ... while debugging it doesn't show the space(unable ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Commenting in Java
    ... Eric Sosman wrote: ... > My favorite comment of all time was found by a colleague ... > debugging someone else's C code: ... I can tell the story of a similar mistake that I once made, ...
    (comp.lang.java.programmer)
  • Re: HEAP crash in release, but not debug.
    ... right, my mistake. ... > SteveK wrote: ... >> I'm pretty green when it comes to debugging, ... I was thinking that I would dump ...
    (microsoft.public.vc.stl)
  • Re: Help, cannot debug in visual studio.NET
    ... A couple of times I made the simple mistake of trying to debug a release ... > I got into trouble again in debugging the web service developed before. ... > have met this problem before and solved by information's on Microsoft ...
    (microsoft.public.dotnet.general)
  • Re: Returning value using Stored Procedure and ASP
    ... it ended up being a stupid mistake... ... creating the recordset. ... single quotes into 2 single quotes to not screw up the query. ... sql = "InsertTrip " ...
    (microsoft.public.inetserver.asp.db)