Re: System.Data.SqlClient.SqlException: Subquery returned more than 1 value.
- From: "Rod" <1gandalf@xxxxxxxxxxxxxxxx>
- Date: Fri, 20 May 2005 09:09:46 +1000
Thanks Bob.
I noticed after I posted that the group was .asp not aspnet, but I
appreciate your willingness to have a look at my problem. I'm much happier
using asp but one has to move with the times, or at least try to.
Rod.
"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:uki9PWIXFHA.160@xxxxxxxxxxxxxxxxxxxxxxx
> There was no way for you to know it, but this is a classic asp newsgroup.
> While you may be lucky enough to find a dotnet-savvy person here who can
> answer your question, you can eliminate the luck factor by posting your
> question to a group where those dotnet-savvy people hang out. I suggest
> microsoft.public.dotnet.framework.aspnet.
>
> However, I'll take a stab at it (I've just started using .Net)
>
>
> Rod wrote:
> > I have a client site where the code below has been working happily
> > for at least four months. Last week an error appeared related to the
> > following SQL statement.
> >
> > The site is using SQL Server 7. The code is ASP.NET
> >
> > An example of the SQL statement is:
> >
> > INSERT INTO OrderItems (ClientID, ProductID, OrderHeaderID, Quantity,
> > Dispatched, BackOrdered) SELECT ClientID, ProductID, 1371 AS
> > OrderHeaderID, Quantity, Dispatched, BackOrdered FROM Basket WHERE
> > RequisitionID = 1369
> >
> > The error message is:
> >
> > System.Data.SqlClient.SqlException: Subquery returned more than 1
> > value. This is not permitted when the subquery follows =, !=, <, <= ,
> > >, >= or when the subquery is used as an expression...
> >
> > There appears to be nothing wrong with the SQL Statement, indeed if
> > run in Query Analyser it executes correctly. I cannot see how the
> > error message relates to the code at all. Nor do I understand why
> > the code worked for four months and has not decided to fail.
> >
> > The context in which the code is called is the procedure below where
> > the SQL statement is passed to the parameter strSQL.
> >
> > Private Sub executeSQL(strSQL as String)
> > Dim conn As New System.Data.SqlClient.SqlConnection(CONN_STRING)
> > Dim cmd As New System.Data.SqlClient.SqlCommand(strSQL, conn)
> > cmd.Connection.Open()
> > cmd.ExecuteNonQuery()
> > conn.Close()
> > End Sub
> >
>
> Well, you're right. This error seems to be totally unrelated to this
> statement. There is no subquery here.
>
> Is the error reproducible? Try using SQL Profiler to trace what's actually
> happening.
>
> Bob Barrows
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
.
- References:
- Prev by Date: Re: ADODB.Field error '800a0bb9' - Working with SQL Server ntext fields
- Next by Date: Re: System.Data.SqlClient.SqlException: Subquery returned more than 1 value.
- Previous by thread: Re: System.Data.SqlClient.SqlException: Subquery returned more than 1 value.
- Next by thread: Re: System.Data.SqlClient.SqlException: Subquery returned more than 1 value.
- Index(es):
Relevant Pages
|