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.
I want connect to SQL Server Compact 4.0 in my ASP.NET application..
Here is example of code:
protected void Page_Load(object sendhttp://stackoverflow.com/questions/asker, EventArgs e) { string connStr = "Data Source=D:\MyDB.sdf;"; string sqlStr = "select * from tblMyTable"; var sqlDataSrc = new SqlDataSource(connStr, sqlStr); GridWithUrls.DataSource = sqlDataSrc; GridWithUrls.DataBind(); }
But I have the next error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server.The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
The SqlDataSource has constructor with three parameters, one of them is 'providerName' so, how to specify that I want definitely use Sql Server Compact provider ? Also I have added System.Data.SqlServerCe reference..
I have been trying to create a sql statement that uses a subquery to join 2 oracle tables to create a strongly typed table adapter. For example:
Select productName, (select categoryName from categories where categories.category_id = products.category_id) as Category from Products
The ASP .Net tutorial I am working through recommends using subqueries instead of joins for the insert, update and delete commands to be automatically generated by Visual Studio 2010. When I click Finish in the table adapter wizard I get the following error (I am using MySQL version 5.1 and the MySQL Data Connector 6.3.5)
Generated SELECT statement. Error in SELECT clause: expression near 'SELECT'. Error in SELECT clause: expression near 'FROM'. Missing FROM clause. Error in SELECT clause: expression near','. Unable to parse query text.
I'm currently trying to install the "new" Microsoft WebMatrix Beta 2 (a web programming IDE). I was trying to use Web Platform Installer for this. But it 404's on the SQL Compact 4.0 CPT2 and it's tools. I was able to get the runtime from the Microsoft downloads page but the tools I am not able to find. I can not install WebMatrix because the tools are a prerequisite.
I am working on a CMS project using ASP.Net 3.5/Visual studio 2008.This is the first week of the project and I am working on the design of the system right now. Needless to say that this is my first project of this scale and I have no idea of what I am doing.
The requirements of the project ask for a light but functional CMS, one which is easy to deploy.So the question is which database to use in this scenario SQLCE or SQLite?
I just downloaded the above but when I look in visual web developer 2010 express I see no data provider reference .
I was wondering how to attach/create db? in the above, is it a clickable option in tools .net framework options or is VS 2010 not ready to use SQL CE 4 yet,
i have installed visual studio 2010 sp1, i have installed everything to do with compact 4 from web platform installer. yet when i try to connect to a compact 4 database, their is no choice for compact 4, there is a choice for compact 3.5 but no 4. If i try to connect using tthe 3.5 choice i get an error. i can add a compact 4 database from the new items menu. but i can not make a connection to it.you can see in this tutorial compact 4 listed in the add connectiojn box, but it is not listed in mine[URL]
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
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.
what is exactly Sql server compact edition? it says that I do not need a sql server to store my databases if I use that in my bin folder? so I can use my mdf databases in app_data folder. is that true?
* 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?
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.
B reports to A C reports to A D reports to A E reports to B F reports to B
and so on......
So, when A logins he should be able to see B,C,D(who are reporting to A) and also E,F(who are actually reporting to B and not directly to A)Please help to write such sql query.
How can I handle more than 4k of text on the new SQL Compact Edition 4? nvarchar only supports 4k and when I change to ntext, I get the same exception as I get using nvarchar(4k), when using the Microsoft.Data wrapper included with Microsoft WebMatrix. Should it normally work using ntext?
I have a SELECT query which grabs data from two different tables however when I run the query the CurrentCallOwner often pulls up the same name twice albeit with a different SLAFailed value. What I am trying to do is bind those two values into one. I thought that running a subquery and using a count would solve this however I all receive are a bunch ones. Do you know how I could bind those values into a single value (i.e. add them up?)
SELECT CurrentCallOwnerx, SLAFailed, COUNT(CurrentCallOwnerx) AS Expr1 FROM (SELECT BSFLBWF_1.CurrentCallOwnerx, COUNT(BSFLBWF_1.Incidentx) AS SLAFailed FROM .SRFILE INNER JOIN BSFLBWF AS BSFLBWF_1 ON BSFLBWF_1.Incidentx = SRFILE.SRONUMBER WHERE (SRFILE.SR_GROUP = '38') AND (BSFLBWF_1.KPIFailx = '1') OR (BSFLBWF_1.SchoolChargex > '0.00') OR (BSFLBWF_1.LANMLEChargex > '0.00') GROUP BY BSFLBWF_1.CurrentCallOwnerx UNION SELECT BSFWES_1.CurrentCallOwnerx, COUNT(BSFWES_1.Incidentx) AS SLAFailed FROM SRFILE AS SRFILE_1 INNER JOIN BSFWES AS BSFWES_1 ON BSFWES_1.Incidentx = SRFILE_1.SRONUMBER WHERE (SRFILE_1.SR_GROUP = '38') AND (BSFWES_1.KPIFailx = '1') OR (BSFWES_1.SchoolChargex > '0.00') OR (BSFWES_1.LANMLEChargex > '0.00') GROUP BY BSFWES_1.CurrentCallOwnerx) AS derivedtbl_1 GROUP BY CurrentCallOwnerx, SLAFailed
I have a table line (ID, LineNo, LineName) having values as :
1, 1, <blank> 2, 2, <blank> 3, 3, <blank>
ID is PK with Auto-Increment and LinNo(I am manually incrementing through ASP.Net Page while record insertion) Now i have to write a query such that it updates LineName column from line table which is blank(as shown above) with values from table linet(linenamet) having values as :
a b c
My trial query is : update line set LineName = (select linenamet from linet);
It gives ERROR as : Subquery returns more than 1 row Expected Result : After Updation it should show line table as : 1, 1, a 2, 2, b 3, 3, c
I have ported an asp.net application form SQL Server Express to SQLCE 3.5 in Visual Studio 008. Although not recommended, everything works like a charm, except for creating datasets for use in SRSS reports.
The Dataset Designer lets me design and test the Tableadapter perfectly, but the XSD fails to compile, and returns error message :
Failed to generate code. Exception of type 'System.Data.Design.InternalException' was thrown.
I'm working on an ecommerce project that is missing 5,000 product pictures.
I am trying to assign all products without pictures into a category located on a mapping table.
I know an insert can be accomplished from one table (or subquery) to another but I only need to find the product IDs and insert them with default values into the category mapping table that has all non-null columns.
The following code is the farthest I can get without help (I'm not strong in SQL), it won't work because my subquery returns many rows while the SQL statement is designed to insert one - I don't know how to handle this...
[Code]....
Any help would be appreciated from those more experienced than I. BTW... there are no known search results for this type of solution - if there is even a solution.
I am working with a sql server database with about 50 stored procedures. The database and stored procedureswere not created by me. The stored procedures all begin with a number in their name.
Example: 17P_Comsetter
The problem I am having is that if I try and execute the stored procedure at the command line in Query Analyzer,the query analyzer appears not to like that the stored procedure begins with a number. For example:
If I try an run the stored procedure as follows:
EXEC 17P_Comsetter
Then I get the following error message:
Msg 102, ..... Incorrect Syntax near '17'
I am using SQL server 2005. Does anyone know why I am getting this error message?
I started the Bakery site demo...everything runs fine on my local machine.When I publish the site to production server in w2k8r2+iis7.5 and with .net 4.0 (integrate) pool, my bakery apps not able to connect to the .sdf file.
Error I got is :
Connection string "bakery" was not found. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Connection string "bakery" was not found.
Source Error:
Line 2: Layout = "_SiteLayout.cshtml";
Line 3:
Line 4: FacebookSocialPlugins.Initialize("[xxx]", "[xxx]","bakery");
I've got an ASP.NET website, and its connecting to a database I've created on SQL Server 2k8 and I'm using windows integrated security on my connection string between asp.net and SQL Server. What account should I give permissions to my database inside SQL Server? Should I give NT AUTHORITYNETWORK SERVICE permission to my database? Right now, I right clicked the network service account, and went to properties, and then I checked my database under "users mapped to this login:" and then in the "database role membership for" diaglogue I then selected public and db_owner. Is that right?