DataSource Controls :: Can Subquery Returned More Than One Value
May 5, 2010
have 2 tables in SQL 2000 developer edition identicals, Prereception and eceptions, on the table Recepcions I have the following trigger:
CREATE TRIGGER [AumentaInventario] ON dbo.Recepcion
FOR INSERT
AS
declare @Codigo nvarchar (50)
,@Cantidad int
[code]...
View 2 Replies
Similar Messages:
Feb 16, 2011
im working on visual Studio 2010, and i have an error on an update.
this is the code in VB.
[Code]....
Thats the code and the error is:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.`
View 4 Replies
Feb 16, 2011
im doing an update in web page by pressing a button. At the start some of the update was from a trigger, but i decided to put the hole update statement in the web page as an updatecommand in VB. this is the error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.The statement has been terminated.and this is the code.
[Code]....
the error is in the updatecommand. And i dont know what is it.
View 1 Replies
Aug 29, 2010
[Code]....
I always received an error of: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
View 1 Replies
Jun 7, 2010
I need to run a query on server1.database1 where subquery meets criteria on server2.database2. Here's my code:
[Code]....
I tried replacing connectionstrings:connectionstring2 with server2.database2.dbo.scheduledvisits but it didn't know where to look to find that besides by using connectionstring1.
View 2 Replies
Apr 21, 2010
[Code]....
Update multiple records with subquery
View 4 Replies
Feb 4, 2010
I have the following SQL Stored to get all online valid articles in my ASP.NET news application:
[Code]....
I'm trying to check if the article checked as never expire when added to the data base and if not checked I need to check if today is between article start and end date.The statement worked but only when added the first article but when there are more than one article it returns with the following error :Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression
View 8 Replies
Aug 24, 2010
When a sql query returns NULL , I can use the following code to evaluate:
[Code]....
When a sql query returns nothing, neither IsDBNull nor is Nothing works. I don't know why some sql queries return null while some return nothing when there are no data returned. But anyway, can somebody tell me how to evaluate nothing value returned in sql datareader in vb.net? When I put the cursor over signInfo variable in debug mode, I can see Nothing show as its value. But the line does not work
[Code]....
View 3 Replies
Feb 18, 2010
I've managed to connect to the database and return a record based upon a login name. I can itterate through the rows printing out the password but I know there's only 1 row (or can test for that) so how do I get the value of the password for the one row without the loop?
Dim supervisorAdapter As New SupervisorTableAdapters.SupervisorTableAdapter
Dim supervisors As Supervisor.SupervisorDataTable
supervisors = supervisorAdapter.GetSupervisorByLogin(login)
For Each count As Supervisor.SupervisorRow In supervisors
Response.Write(count.password)
Next
View 3 Replies
May 27, 2010
I am viewing items returned from a dataset in an Infragistics chart control. My problem is that due to a weak point in the control, I am left looking for a way to manipulate the height of the chart based on the count/number of items returned by the ObjectDataSource(DataSet).
Does anyone one have an existing C# sample they could let me view of accessing the count of records returned within the code-behind of a page that I could then use within a case statement to set the hight of the control?
View 7 Replies
Feb 14, 2010
I'm developing a website using asp.net 2.0 . I have retrieved a record from database through the query.
SqlConnection con = new SqlConnection(connectionstring);
con.Open();
String SQL = "SELECT * FROM Table where attribute1 = value";
SqlCommand cmd = new SqlCommand(SQL, con);
SqlDataReader reader = cmd.ExecuteReader();
Sometimes, there is no record matching this query and so null value is retrieved. My question is how to find that the null value is returned. Since If (no record found i.e NULL) certain actions needs to be done and if (records found i.e NOT NULL) ceratin different actions needs to be carried out.
View 10 Replies
Feb 17, 2011
I want to run a SUM on a particular against the DataSet returned by a SqlDataSource. How can I access the DataSet stored in memory that is returned by the SqlDataSource to run this calculation?
View 2 Replies
Feb 26, 2010
I am having some difficulties with a particular task. I am creating a support desk intranet application and I am trying to write a method within a class within a namespace which will form a generic database connection which can be called from any of the aspx pages so that I have the dbconnection logic in one place; you know, going along with the 'DRY' (Don't Repeat Yourself) mantra.
The Namespace:
SUPPORTDESK.SQL.dbconnection.pullData()
Objective of the method:
To provide any aspx code behind file with an SQL Server 2005 Express Connection and if possible return the data from an SQL Query. This is where I need advice do I create the method such that it simply forms the connection and returns a DataSet or that it returns an SQLConnection object? If i've got things back to front and upside down don't worry I'm a beginner with ASP.NET. The Method so far:
[Code]....
If I'm on the right track how do I access the data returned in the DataSet?
View 3 Replies
Mar 30, 2010
I have a stored procedure 'RoomIfExists' on my sql server (it does work). It takes a string variable for the Room_No and returns either '1' or '2' depending on the result of the query.
[Code]....
I need to know how to run the sp in c#, passing the variable Room_No and then pull the result from it.I am using a data reader.
View 2 Replies
Feb 8, 2010
I'm attempting to further reduce a dataset/table by various user input. Part of this process is grouping the data by a timestamp prior to a summation. I'm trying to use LINQ and cannot get the data returned that I need.
[Code]....
View 7 Replies
Apr 15, 2010
I am trying to run the following SQL query
string strConString = ConfigurationSettings.AppSettings[ "conString" ];
myConnection = new OdbcConnection(strConString);
myConnection.Open(); // open connection
string strSelect= "select * from tbl_howells_product_data where title like" + "'" + strsearch + "%" +"'" + "order by product_id asc";
OdbcCommand myCommand = new OdbcCommand(strSelect, myConnection);
dtrReader=myCommand.ExecuteReader();
The problem is I need to check to see if any data has been returned from the SQL query, if there are no rows/ data returned by the query then I need to display a message to say that there aren't. I know that there isn't a 'number of rows method' for the dtrReader, so does anybody know how I could do this?
View 3 Replies
May 11, 2010
inside procedure, how to know a sql returned records or not?
View 7 Replies
Apr 23, 2010
This may not be the correct place to put this as it is both a stored procedure AND Visual Studio 2008 problem.
I have the following stored procedure:
[Code]....
I have been mokeying around with it because of what is happening. I have a dataset, call it dataset1. I drag this stored procedure onto the dataset. I EXPECT a datatable to appear, instead the data set adds this store procedure to the queries table adapter and sets the exec mode to 'NonQuery' which unless I am very mistaken, means "don't expect a dataset back from this' when in fact you DO expect a dataset back from this.
The SQL server is a Windows 2000 Server running SQL 2000. It has never caused us a moments grief since we set it up oh-so-many years ago.
If I connect to a different database and drag a query into the same dataset I get a datatable as I expect. I cannot see where / how this procedure could be wrong. The query when executed returns exactly the data I expect, in the format I expect (looks like a table, acts like a table in the Query analyzer).
View 3 Replies
Jan 17, 2010
I have executed my query in VB with:
[Code]....
I now want to count the number of returned rows so that I can say:IF rows_returned = 1 then login else deny
I think you get the idea.P.S. I know this is not the most secure method of login but I do not want to use the ASP.NET configuration manager as I like to understand what is happening. I am starting off very simple and I shall work up from there.
View 1 Replies
May 1, 2010
SQL Select Union and total number of returned rows?
View 3 Replies
Mar 14, 2010
I have a standard gridview, with the standard paging and sorting interface enabled.The application holds appointments for three organisational units, with a maximum of 3000 appointment records being returned across all three units. The appointment records are quite small.
The choice I am faced with is to:
1. Have an Org Unit dropdown which returns to the datasource on change of selection and at inital databind, and returns appointment records for one org unit at a time i.e. approx 1000 records.
2. Have the objectdatasource return all 3000 appointment records for all org units at initial databind, and filter the objectdatasource by org unit on change of selection, thereby saving a trip to the datasource.
I guess the question boils down to identifying the point at which querying the datasource by org unit is more efficient than filtering the records returned by org unit.
Is 3000 records a lot for a gridview to be paging and sorting etc.
View 3 Replies
May 10, 2010
[Code]....
_
[Code]....
View 4 Replies
Sep 13, 2010
I have a problem regarding this code:
select NotificationID, (select u.UserName from aspnet_Users u, notifications n where u.UserId = n.FromID) as 'UserName', [Message], DateCreated, TypeID from Notifications n, aspnet_Users u
View 2 Replies
Jan 24, 2011
I have been utilising a SELECT query such as the following:
SELECT SRFILE.SR_GROUP, SRFILE.SROWNERSHIP, SRFILE.SRCONMAE, BSFLBWF_1.Incidentx,
BSFLBWF_1.Severityx, BSFLBWF_1.Openx, BSFLBWF_1.Closex, BSFLBWF_1.Closurex, BSFLBWF_1.Customerx, BSFLBWF_1.Availabilityx, BSFLBWF_1.KPIx,
CONVERT(Decimal, BSFLBWF_1.Minsx) AS Expr1, BSFLBWF_1.Unusedx, BSFLBWF_1.FirstIntx, BSFLBWF_1.RepeatIntx, BSFLBWF_1.Corex,
BSFLBWF_1.OffPeakx, BSFLBWF_1.NonCorex, BSFLBWF_1.DedTypex, CONVERT(money, BSFLBWF_1.SchoolChargex) AS Expr2, CONVERT(money,
BSFLBWF_1.LANMLEChargex) AS Expr3, BSFLBWF_1.KPIFailx, BSFLBWF_1.Overridex, BSFLBWF_1.Reasonx, BSFLBWF_1.Contactx,
SRFILE.SR_CLOCK, SRFILE.SR_BACK_REASON, CONVERT(int, BSFLBWF_1.Minsx) / CONVERT(decimal, BSFLBWF_1.FirstIntx)
* 100 AS PERCENTAGE
FROM support.SRFILE INNER JOIN
BSFLBWF AS BSFLBWF_1 ON BSFLBWF_1.Incidentx = SRFILE.SRONUMBER
WHERE (BSFLBWF_1.Closex IS NULL) AND (BSFLBWF_1.DedTypex = 'School' OR
BSFLBWF_1.DedTypex = 'LAN-MLE')
UNION ALL
The rest of the query continues as the above albeit selecting the same data from different tables and works fine.
The issue I have is that I want to Select some more data (another SELECT query) but with a different Where clause e.g. WHERE (BSFLBWF_1.KPIx NOT LIKE 'KPI%' OR
BSFLBWF_1.KPIx NOT LIKE 'Proactive%') AND (BSFLBWF_1.Availabilityx LIKE '')
The problem is that this WHERE clause returns data which the above in bold has null values for (and thus doesnt work). Im still selecting the same data its just the WHERE Clause has changed. Is it possible to run such a query? If so, can it be done via a sub query?
View 10 Replies
May 20, 2010
I have a tables with data like this
Id BookId TagId
34 113421 9
35 113421 10
36 113421 11
37 113421 1
38 113422 9
39 113422 1
40 113422 12
I need to write a query (SQL Server) which gives me data according to the tags say if I want bookIds where
tagid =9 it should return bookid 113421 and 113422 as it exists in both the books, but If I ask data for tags 9 and 10 it should return only book 113421 as that is the only book where both the tags are present.
View 3 Replies