I have a table under SQL2005 express with 8 fields with a primaryKey defined.
In my BLL in the table adapter there is one "SELECT DISTINCT prodCAT from prods"
The prodCAT is a nvarchar(50) and it is not part of an index or primaryKey.
When I preview the data from my BLL I get the correct data.
I defined a new web form (aspx) and put a ddl (dropDownList) with an objectdataSource that relates to the above sql function/command
and I get a
"Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints."
BTW when I defined the above SQL in the BLL I got a "The new command text makes the function return data with schema different from the schema of the main query"
I know this is probably a flick of a switch but I cannot figure out which switch. Setup is SQL Server / Stored Procedures / DAL / BLL(skipped for testing) / PL. The stored procedure queries from only one table and two columns are ignored because they are being phased out. I can run the stored procedure and preview the data in the DAL but when I create a page with an ODS linked to the DAL and a GridView I get this error. I checked every column that does not allow nulls and they all have values. I checked unique columns (ID is the only unique and is Identity=Yes in the table definition). I checked foreign-key columns for values that are not in the foreign table and there are none. Any ideas why do I get this? Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Hi, I am getting the above error when trying to load a report into my Web Application, I have tracked the error down to one specific field in my database. Even though this field is a NVarChar field and is of size 30 it would seem that there is an issue returning the value from the field. I can write it into the database no problems but when I try to get it out of the database it returns the above error. e.g MOB 401.908.804 - Fails 0401.907.324 - okay 8239 9082 (pager) - fails Anyone got an idea on how to fix this???? Regards.. Peter.
I have to admit I'm pretty new to ASP.net. I'm trying to insert a row of data into my SQLExpress database table "Prets" I'm getting the user_ID from the table "Membres" Here's the code I have: Imports System.Web.UI.PageImports System.Security.PrincipalImports WiseNetTableAdaptersPartial Class membre_sec_Pret_demande_pret Inherits System.Web.UI.Page Protected Sub submit_btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submit_btn.Click Dim User As String = My.User.Name Dim pretAdapter As New PretsTableAdapter Dim membreAdapter As New MembresTableAdapter pretAdapter.AjouterPret(Convert.ToInt32(membreAdapter.GetUserIDbyName(User)), Convert.ToDecimal(montant_txt.Text), Convert.ToString(raison_txt.Text)) End SubEnd Class And here's the error I get at runtime: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.Source Error:
Line 1610: } Line 1611: WiseNet.MembresDataTable dataTable = new WiseNet.MembresDataTable(); Line 1612: this.Adapter.Fill(dataTable); Line 1613: return dataTable; Line 1614: }Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Fileswisenetindustriesafc388c716067f12App_Code.tyietv41.0.cs Line: 1612 Stack Trace:
does anyone had any idea on the following codes that i'm facing?i have no ideas what is constraints and i hardly can view my page. In addition to that, i also faced the same problems when i'm trying to change my user password. it eventually managed to change the password but then the changes leads to the failed to enable constraints too. however, the following codes is not related to the change password but the purchase item. Hope someone can help me up! thanks!
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Source Error:
Line 223: SqlDataAdapter2.SelectCommand.ExecuteNonQuery() Line 224: SqlConnection1.Close() Line 225: SqlDataAdapter2.Fill(BuyData2) Line 226: i = BuyData2.BuyView.Count Line 227: For n = 0 To i - 1
Hi, I have two tables (Accounts and Contacts) that have a many-to-many relationship, maintained by the AccountContactLinks table. I would like to populate a Contacts DropDownList with all of the Contacts associated with the Account Selected in Accounts DropDownList. Here is the (SP) SQL Query I'm trying to make work: SELECT Contact.ContactID, Contact.ContactLastName, Contact.ContactFirstName, Contact.ContactLastName + ', ' + Contact.ContactFirstName AS ContactName FROM Contact INNER JOIN AccountContactLinks ON Contact.ContactID = AccountContactLinks.ContactID WHERE (AccountContactLinks.AccountID = @AccountID) ORDER BY Contact.ContactLastNameEND I keep getting the following error: Failed to enable constraints. One or more rows contains values violating non-null, unique or foreign key constraints. I haven't implemented any non-null, unique or foreign key constraints between any of these tables, so suspect that I've got the SQL Query wrong. Thanks very much. Regards Gary
Hi, I am trying to use a typed dataset created using the Query builder which returns the data correctly when I use 'Execute Query' in query builder but as soon as I attempt to return a dataset using the GetData method created I get the following error: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Which is not very helpful, any ideas where the problem may be? I have tried switching off enforce constraints and setting the NullValue property of all strings to 'Emtpy' bu that has no effect. Thanks in advance
Is there any procedure or option to disable and enable constraints on database.the problem is we are having lot master and child tables. when i am trying to move the entire data from original db to another same db, there i am getting constraints problem. child tables are not accepting data with out loading the master tables.
is there any to disable and enable constraints? please give me reply asap
I currently have serverA importing data from an AS400 oledb connection and serverB on hot-standby as a mirror. The data import is being performed via an SSIS scheduled job.
I've yet to implement any solution in the following case: If the database on serverA fails, it will failover to the mirror. But the jobs will still be on serverA. Ideally, I'm assuming the jobs should not run on serverB since it will be attempting to update the mirrored database. So, I am wondering if both servers can have identical copies of SSIS packages and jobs and simply (?) enable or disable them based on which server will be hosting the principal database.
Is there any solution where the jobs can automatically be disabled on the server with the mirrored database and enabled on the principal database depending on its status?
I have a SQL 2005 database and am running the 2.0 framework. I cannot seem to enable SQL caching on the db. I'm using the command line tool as follows: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727>aspnet_regsql -S 99.99.999.999 -Uwebteam -P sa -t tblname -d dbname -et Enabling the table for SQL cache dependency. .An error has happened. Details of the exception:The database 'dbname' is not enabled for SQL cache notification. To enable a database for SQL cache notification, please use the System.Web.Caching.SqlCacheDependencyAdmin.EnableNotifications method, or the command line toolaspnet_regsql. To use the tool, please run 'aspnet_regsql.exe -?' for more information. C:WINDOWSMicrosoft.NETFrameworkv2.0.50727>
I've replaced the ip address, dbname and tblname with ficticious names for obvious reasons here in the post. What command can I enter to enable the database for caching?
I have two databases. one is bayan and other is clearance. clearance was already there. i created new bayan. both database having same things. such table ,views. both contains arabic and english records.
when i try to fetch records from clearance table as arabic it is working the query is like: select * from customers where cust_name_araibc='here arabic text'
it is working fine
but same query i try with bayan databses it runs but it doesnt display any records.
So is there anything like to enable languages in sql server databses.
All, I am using SSIS in sqlserver. I wanted to enable logging in SSIS. I just want to log all the activities in the log file. How can i enable logging in SSIS? I would appreicate if any one could answer for this. thanks in Advance.
Hi!I know that you can enable/disable a trigger through the altertable command. Once a trigger is disabled, is there a wayto determine whether it is disabled or enabled? I see there is astatus column in sysobjects ...is that what I should be using?thanks in advance for any helpKaren
I understand that SQL2005x64 bits ignore AWE enable in SQL because it can address all the memory without having to use AWE. How about 32 bits SQL2005, does it support AWE enabled??
I was testing my error handling and purposefully failed some messages. Automatic posion message detection kicked in and disabled my queue. I tried the following, one at a time to enable it again but it doesn't work:
ALTER QUEUE MigrationQueue WITH STATUS = ON;
ALTER QUEUE MigrationQueue WITH STATUS = ON, ACTIVATION (STATUS = ON);
I would have thought the first line would've worked but I get the following when trying to receive...
The service queue "MigrationQueue" is currently disabled.
I have a problem on creating a report using Microsoft SQL Server Business Intelligence Development Studio. I am new to this environment, anybody here can help me on how to enable the "DrillDown" on the table?
When I am using the wizard, the option to enable the drill down will appear, but when I am using "Report Server Project", I really don't know how to enable it, and theres was no table properties on how to enabled it.
Hi, I am using DMO + VBScript to enable the xp_cmdshell feature in SQL Server 2005 Express. But I get error "Item cannot be found in the collection corrosponding to the requested name or ordinal". Here is the script which I am using:
Dim excmd: Set excmd = CreateObject("ADODB.Command") Set excmd.ActiveConnection = connx ' This was created earlier using sa login and connected to master database
excmd.CommandType = 4 excmd.CommandText = "sys.sp_configure" excmd.Parameters.Refresh excmd.Parameters(1).Value = "show advanced options" excmd.Parameters(2).Value = 1 excmd.Parameters(3).Value = Null excmd.Execute () ' This line failes If (Err.Number <> 0) Then LogText "Unable to execute stored procedure. " & Err.Number & " " & Err.Description Exit Sub End If
excmd.CommandText = "RECONFIGURE WITH OVERRIDE" excmd.Parameters.Refresh excmd.Execute () If (Err.Number <> 0) Then LogText "Unable to Refresh. " & Err.Number & " " & Err.Description Exit Sub End If
If (Err.Number <> 0) Then LogText "Unable to execute sp xp_cmdshell. " & Err.Number & " " & Err.Description Exit Sub End If
excmd.CommandText = "RECONFIGURE" excmd.Parameters.Refresh excmd.Execute () If (Err.Number <> 0) Then LogText "Unable to Refresh after running sp. " & Err.Number & " " & Err.Description Exit Sub End If
I have a date parameter that users can not choose because it is grayed out. The Prompt User property is checked in Report Manager. What else do I need to do to enable this functionality. I'm using SSRS 2005
I have a number of SqlDataSource objects in my application, which don't have Optimistic Concurrency option enabled. The SDS objects use custom Sql statements so I can no longer select the Advance button to enable Concurrent Concurrency. How can I enable this option? Is there a designt ime property, and even a run time property that can be set? The only method we have so far is to create a new SDS, with Optimistic Concurrency switched on, then copy and paste my custom Sql into it and rebind my components.. Any help on this matter is appreciated. Regards, Steven
Hi guys I have a program which imports data into sql server from csv files. This program uses the something like this
CREATE PROCEDURE MyImport ( @FileName AS VARCHAR(200) ) AS SET NOCOUNT ON DECLARE @SQL VARCHAR(4000) SET @SQL = ' SELECT * FROM OpenRowset(''MSDASQL'', ''Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=C:;'', ''SELECT * FROM ' + QUOTENAME(@FileName) + '' + ''') as t ' EXEC (@SQL)
when i excute this i get a permission error saying the account i specified in the web config doesn't have rights to run these type of scripts. I tried using the sa account which works. But its not recommended to setup applications to access the database using the sa account. i did some research and i found out that yon can actually enable that by change a registry key. But i cant find the MSDASQL datasource under ms sql server providers in the registry. Any other ways i can enable this?
Hi. I right click the (root) Solution Explorer to add an SQL object (something.mdf) but I get an error message that "Generating user instances in SQL Server is disabled. Use sp_configure 'user_instances enabled' " WHERE DO I WRITE THE SP_CONFIGURE CODE IN VISUAL WEB DEVELOPER ? (I don't see anything like new query of server and the one in the SQL SERVER management studio is already done). 10x
Hi.,please help.,i get this error.,i made my web and deploy it in a different system which is winserver03, we have in the same network.how will i enable SQL remote access: Server Error in '/' Application.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
Hello, I got the error: ______________________ Reporting Services Error
* For more information about this error navigate to the report server on the local server machine, or enable remote errors SQL Server Reporting Services ______________________
I saw the answer: "You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table."
How can I get to the ReportServer.ConfigurationInfo database table?
I am on the reportservice server and I run "reporting services configuration manager" and the "sql server managment". I didn't saw that option :(
How to enable remote connections on TCP/IP?I have just installed for first time SqlServer 2000,and cannot connect from other host via ODBC.I give hostname or address but it does not connect.I checked on my firewall that there is no listenning socketon port 1433 nor 1440 on sqlserver host.I can only connect using "(local)" server in ODBC on sqlserver host.Regards,Mark
I'd like to know how can I setup the SSL so I can secure my HTTP Endpoint.
I saw in the documentation that some settings such as SSL_PORT and PORTS should be set to SSL port number and SSL but I did not find out anywhere where they explain how to enable SSL.
Do we enable SSL the same way we enable it or SQL Server 2005 or does that have to be done through the MMC - Certificates.
I don't have any IIS server running on this server, so I was wondering if IIS is a requirement to generate and import the certificate.
Is there a way to allow specific databases access to the CLR. Currently, my understanding is that when this setting is enabled, it applies to all databases within the instance.