Re: DataTable.select problem with variables

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This is one of the things that has bugged me about the Select method on
the data set for the longest time. We have ways of parameterizing queries
to the database, and I always felt that we should have something similar for
datasets.

Fortunately, LINQ to DataSets will fix a lot of that.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Manikandan" <plmanikandan@xxxxxxxxx> wrote in message
news:1178019973.195673.179770@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
    ... problem from sql server 2000 ... 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)