Do We Have To Create Connection Before Creating SqlCacheDependency?
May 23, 2008
do we have to create connection and assign it to command object before creating SqlCacheDepency? chek the code below. SqlServer is not invalidating cache when there is update. When i create Dependency using command object, at that time command object does not have connection. It will assign connection to command object in Excute method
SqlCommand cmd = new SqlCommand(commandText);
cmd.CommandType = CommandType.StoredProcedure;
SqlCacheDependency cacheItem = new SqlCacheDependency(cmd);
DataSet result;
result = DBHelper.Execute(cmd);
HttpRuntime.Cache.Insert(cacheItemName, result, cacheItem);
View 4 Replies
ADVERTISEMENT
Aug 30, 2006
When I create a new odbc connection to a SQL server 2005 Db I get a failure telling me dat de SQL server does not allow remote connections.
How can I allow the server to allow this.
Any help appreciated
regards
View 1 Replies
View Related
Jul 20, 2006
I've been having trouble getting the SqlCacheDependency to work without polling (which is set up through SqlCacheDependencyAdmin or aspnet_regsql). If you check out the documentation it says things like:
Microsoft:
View 18 Replies
View Related
Feb 1, 2007
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?
View 4 Replies
View Related
May 21, 2007
I have implemented a caching strategy using the sqlcachedependency and sql server 2005 backend using the broker service.This works fine and well when i am connecting to the SQL Server 2005 under service account that is in the role db_owner. In a production enivironment i am reluctant to do this so i created another service account that only has execute permissions on the stored procedures.When i use this limited service account for my ASP.net web application, the broker service does not send any messages to the web app to invalid the cache. When checking the event log and SQL profiler i get errors all relating to the user not having access to the SqlQueryNotificationService queue. So i did a lot of googling and tried running the grant scripts below with no luck using this limited service account. Keep in mind everything works fine if i use an account with db_owner priviledges. These are the grants i have tried based on numerious articles GRANT CREATE PROCEDURE TO three_d_ss_loginGRANT CREATE QUEUE TO three_d_ss_loginGRANT CREATE SERVICE TO three_d_ss_loginGRANT SUBSCRIBE QUERY NOTIFICATIONS TO three_d_ss_loginGRANT RECEIVE ON QueryNotificationErrorsQueue TO three_d_ss_loginGRANT REFERENCES ON CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification] TO three_d_ss_login These are the grants i have tried that does not work GRANT SEND ON SERVICE::SqlQueryNotificationService TO three_d_ss_loginGRANT RECEIVE on SqlQueryNotificationService_DefaultQueue to three_d_ss_loginCan some one suggest what i need to do to get sqlcacheddependencies to work with a sql2005 backend under a limited priviledged service account? ThanksJim
View 4 Replies
View Related
Jun 25, 2007
Hi, I'm trying to set up a SqlCacheDependency using the Query notifications of SQL Server 2005.
I haven't even got to the point of testing the notifications part. My problem is that my DataTable is not
even getting stored in the cache when I insert it. The cache seems to be getting invalided as soon
as I add the DataTable. Here is my code:
(am trying to get a simple example working first)protected void Page_Load(object sender, EventArgs e)
{ DataTable results = (DataTable)HttpRuntime.Cache.Get("supplyFunctions");
if (results == null)
{ Response.Write("Cache Invalidated, hitting DB. TIME: " + DateTime.Now.ToString());
results = getSupplyFunctions();
}
else
{ Response.Write("got from Cache, TIME: " + DateTime.Now);
} GridView1.DataSource = results;
GridView1.DataBind();
}private DataTable getSupplyFunctions()
{ DataTable results = new DataTable(); using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()) )
{ using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "schema.myStoredProc"; command.CommandType = CommandType.StoredProcedure;
SqlCacheDependency dependency = new SqlCacheDependency(command); SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command; DataSet dataset = new DataSet();
adapter.Fill(dataset);
results = dataset.Tables[0];
HttpRuntime.Cache.Insert("supplyFunctions", results, dependency);
}
} return results;
}
Also, whats weird is that when I keep refreshing the page, after like 5 to 10 minutes it works, and starts caching the data.
This disturbs me-- I would like to know what is going on. I am pretty sure my stored procedure doesn't break the rules of the query notifications. Can someone help me out?!??!
Thanks!
View 2 Replies
View Related
Sep 30, 2007
Hi all,I've been able to successfully use SQLCacheDependency and my test application is using only one database table to test SQLCacheDependency. Now, I was reading "Programming Microsoft ASP.NET 2.0" by Dino Esposito and I've couple of questions.a)-SQLCache will expire on Insert, Update and Delete queries on the database table? Am I right? b)-Right now I'm using SQLCacheDependency on one table, can I use it on more than one table ? If I can't , can you please give me some ideas on how to use SQLCacheDependency on more than one table? c)-Lastly, If large number of clients are using my application, what about the performance gains/losses if I use SQLCacheDependency? I will really appreciate your help. Thanks,Oltmans
View 1 Replies
View Related
Oct 1, 2007
Hi All,I've successfully implemented an example of SQLCacheDependency on one database table. I was reading "Programming Microsoft ASP.NET 2.0" by Dino Esposito and I've couple of questions. I will really appreciate your help.a)-Can I use SQLCacheDependency on more than one database tables? If I can't then I will appreciate if you can give me couple of hints as to how to do this.b)-As I understand SQLCache on a table will expire if any Insert and Update SQL operations happen on that table.c)-Our software is being used by many clients. Do you think SQLCacheDependency will have some sort of performance hits?I will really appreciate any help.Thanks,Oltmans
View 1 Replies
View Related
Oct 10, 2007
I am using SqlCacheDependency to monitor a database table for changes.
Unfortunately, it is polling the table too often and is causing
performance issues. It seems to poll at least once a second. So now I'm
trying to find a way to adjust it so that it polls about once every 10
seconds.The
code that uses the SqlCache Dependency is located in a Class Library
Project that is used by my web application project. The code is as
follows:// in the class constructorSqlDependency.Start("...some connection string");// in the body of a methodusing (SqlConnection connection = new SqlConnection("...same connection..."){ connection.Open(); SqlCommand command = connection.CreateCommand(); command.CommandText = query; SqlDependency dependency = new SqlDependency(command); dependency.OnChange += OnDepChange; SqlDataReader data = command.ExecuteReader(); // code that uses the data goes here}public void OnDepChange(object sender, SqlNotificationEventArgs e){ DoSomething();}I
did a little searching on the web and noticed that some examples showed
that you could adjust the pollTime in the web.config file:<sqlCacheDependency enabled="true" pollTime="30000"> <databases> <add name="Pubs" connectionStringName="PubsConn" /> </databases></sqlCacheDependency>However,
as I stated earlier, the code that uses the SqlCacheDependency is
located in a Class Library, so this configuration doesn't help me. Is
there a way to adjust the pollTime without getting my connection string
from the web.config?
View 1 Replies
View Related
May 1, 2006
I can create a SqlCacheDependency, and link it to a cached item in httpcontext cache. When something change, it will remove the cached item from the cache. I think I have to redo the process when that happens - prepare sql command, create SqlCacheDependency and insert the item into cache. Now I only need a notification from my SQL when something changes in one of my table, I don;t need read anything from db, and I think I should find a way to not recreate the SqlCacheDependency object everytime?
any suggestion?
View 2 Replies
View Related
May 3, 2006
I have some problem with ASP.NET cache, I found other people has similar problem, but I didn't find real solution.
The one bother me most is the SQLCacheDependency doesn't work stable. I insert object in cache and has SQLCacheDependency linked. After a period of time, it stopped working. That means the the object is still in cache, but change on db side doesn't remove the cache entry. I am not sure if it is ASP side or SQL side, I feel it is ASP side.
I am using 2.0 + SQL 2005.
Once the db command notification stop working, you have to restart IIS or clear all items in cache since you don't kno which one is changed.
Any suggestion?
View 12 Replies
View Related
Sep 12, 2007
I've set up a SqlCacheDependency in my Asp.Net application, but the dependency invalidates the cache immediately every time the page is hit.
I think the problem may be with my SQL Query, but it seems to me to meet the requirements on the Special Considerations When Using Query Notifications page on MSDN. Could someone take a look at this query and tell me if I've done something wrong? Thank you.
Here's my query:
Code Snippet
USE [chameleon]
GO
SET ANSI_NULLS ON
GO
SET ANSI_PADDING ON
GO
SET ANSI_WARNINGS ON
GO
SET CONCAT_NULL_YIELDS_NULL ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NUMERIC_ROUNDABORT OFF
GO
SET ARITHABORT ON
GO
ALTER PROCEDURE [dbo].[usp_customers_by_site_id]
@site_id INT
AS
SELECT
customers.customer_id,
customers.name,
customers.po_prefix,
customers.dt_created,
customers.created_by AS auid,
customers.po_required
FROM dbo.customers
WHERE customers.site_id = @site_id
AND customers.is_active = 1
and here's the code in my Asp.Net site where I try to use the SqlCacheDependency:
Code Snippet
public List<Customer> GetCustomersBySite(int siteID)
{
List<Customer> customers = new List<Customer>();
if (HttpRuntime.Cache["CustomersBySite" + siteID] != null){
customers = (List<Customer>)HttpRuntime.Cache["CustomersBySite" + siteID];
}
else
{
using (SqlCommand command = new SqlCommand("usp_customers_by_site_id", Connection)){
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@site_id", SqlDbType.Int).Value = GetDBValue(siteID, false);
SqlCacheDependency dependency = new SqlCacheDependency(command);
try{
Connection.Open();
SqlDataReader reader;
reader = command.ExecuteReader(CommandBehavior.SingleResult);
while (reader.Read()){
customers.Add(PopulateCustomer(reader));
}
HttpRuntime.Cache.Insert("CustomersBySite" + siteID, customers, dependency, DateTime.Now.AddMinutes(Configuration.CacheDuration), System.Web.Caching.Cache.NoSlidingExpiration);
}
finally{
Connection.Close();
}
}
}
return customers;
}
View 1 Replies
View Related
Jun 15, 2006
I am using a grid to display the data on my webpage, and I have 3 projects in my solution (UI, BLL, DAL). When I load the webpage I am creating the instance of a class written n my BLL project to populate the data, and in BLL I'm creating the object for the class in DAL and returning the datatable.
Now when I refresh the page using F5, the SQLDependency is working fine. But, when I use the Paging or Sorting option's on my grid I see in SQL Profiler that the query is posted back to the SQLServer to get the data.
If this is the senario then how can I make use of the cache object in .NET 2.0.
Please advice,
Ravi
View 1 Replies
View Related
Jul 24, 2006
Decided to try testing SqlCacheDependency and got the following.... thoughts???After using the following code...void Application_Start(object sender, EventArgs e) { System.Data.SqlClient.SqlDependency.Start (ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString); }//-------------------------------- ... then more code SqlCommand sqlCommand = new SqlCommand("select ApplicationName from dbo.aspnet_Applications", sqlConnection); SqlCacheDependency sqlCacheDependency = new SqlCacheDependency(sqlCommand);//-------------------------------- ... then more codeMembershipUser membershipUser = Membership.CreateUser(defaultUserNameTextbox.Text, defaultUserPasswordTextbox.Text); if (membershipUser != null) {//----------------------------- ... more codethe above code no longer works giving the below exception : using a plain database generated using the following statement
"aspnet_regsql -E -S . -d testDatabase -A all"
[SqlException (0x80131904): UPDATE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +177
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +68
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2300
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +147
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +413
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +115
System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +3325
System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +214
System.Web.Security.Membership.CreateUser(String username, String password, String email) +31
System.Web.Security.Membership.CreateUser(String username, String password) +7
testCustomMembership.defaultCreateUserButton_Click(Object sender, EventArgs e) in c:projects
esearchsamplehandler estCustomMembership.aspx.cs:33
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4861
View 1 Replies
View Related
Jul 25, 2006
I have SQL Server 2005 and I am using .Net 2.0.
Is there a way to cache a query, basically I am going to do a SELECT * on a table that is called frequently.
I then want to query this DataTable that is in cache. I want to invalidate the cache when the table changes.
Everything I have read tells me to use the output caching directive. But, much of what I am doing doesn't end up in the output. Is there a way to invalidate the cache the same way without output caching and using the Service Broker?
View 1 Replies
View Related
Oct 16, 2007
Hello,
I have tried two ways for executing a query and creating a dependency
on it, one using plain Sql commands, the other using Enterprise
Library wrapped commands.
I keep getting:
Warning: Fatal error 682 occurred at Oct 12 2007 11:01AM. Note the
error and time, and contact your system administrator.
string xml = cmd.ExecuteScalar() as string;
When I execute it. Does anyone know what could cause this.
I have read both of these posts and have not yet been able to
investigate the SQL machine's event viewer though:
http://forums.asp.net/p/959871/1188606.aspx#1188606
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1203630&SiteID=1
The "value" column is an XML datatype field.
Thanks,
Josh
public static ContentXmlUtilResult GetContentXml(
string key,
bool createDependency)
{
ContentXmlUtilResult result = new ContentXmlUtilResult();
string connString = Global.Current.ConnectionString;
using (SqlConnection conn =
new SqlConnection(connString))
{
SqlCommand cmd =
new SqlCommand(
"SELECT Value FROM dbo.ContentXml WHERE [Key]
= '" + key + "'",
conn);
if (createDependency)
{
System.Web.Caching.SqlCacheDependency dependency =
new SqlCacheDependency(cmd);
result.Dependency = dependency;
}
conn.Open();
string xml = cmd.ExecuteScalar() as string;
conn.Close();
result.Content = xml;
}
return result;
//SqlCommand cmd = (SqlCommand)
// Global.Current.Database.GetSqlStringCommand(
// //@"SELECT Value FROM dbo.ContentXml WHERE [Key] =
@Key");
// @"SELECT Value FROM dbo.ContentXml WHERE [Key] = '"
+ key + "'");
////cmd.Parameters.Add("@Key", SqlDbType.VarChar).Value =
key;
//if (createDependency)
//{
// System.Web.Caching.SqlCacheDependency dependency =
// new System.Web.Caching.SqlCacheDependency(cmd);
// result.Dependency = dependency;
//}
//string xml = Global.Current.Database.ExecuteScalar(cmd)
as string;
//result.Content = xml;
//return result;
}
View 1 Replies
View Related
Jan 31, 2006
I've the following simple code bound to a button on a Web page
string time = (string)Cache["KEY"];
if (time == null)
{
SqlConnection sqlConnection = new SqlConnection(@"Server=BIZYUSUFSQL2005;Database=Deneme;User Id=sa;Password=;");
SqlCommand command = new SqlCommand(@"select KOLON1 from dbo.CACHE", sqlConnection);
sqlConnection.Open();
SqlCacheDependency dependency = new SqlCacheDependency(command);
time = System.DateTime.Now.ToString();
Cache.Insert("KEY", time, dependency);
command.ExecuteNonQuery();
sqlConnection.Close();
}
return time;
This code has to return the time value from cache. And when a record is inserted into the CACHE table, the cache item has to be invalidated and the new time value has to be returned.
The code works properly for 2-3 minutes. But when there is no activity for 5 minutes, the cache invalidation does not work anymore.
View 1 Replies
View Related
Nov 27, 2006
I created a UDT Type (using MS Server Express Edition and Visual Basic 2005 express) but I get some errors:
Msg 6556, Level 16, State 1, Line 6
CREATE TYPE failed because it could not find type 'UDTProj' in assembly 'UDTProj'.
Msg 6597, Level 16, State 1, Line 6
CREATE TYPE failed.
That is my code:
Public Structure UDT_interval
Private adresse As String
Private beginn As Date
Private ende As Date
End Structure
************in Transact-SQL
//register the UDTProj assembly
USE TestData;
CREATE ASSEMBLY UDTProj
FROM 'C:MS Visual StudioMyOutputinReleaseUDTProj.dll '
WITH PERMISSION_SET = SAFE;
// create the UDTProj type
CREATE TYPE dbo.UDTProj
EXTERNAL NAME UDTProj.[UDTProj];
or
CREATE TYPE dbo.UDT_interval
EXTERNAL NAME UDTProj.[UDT_interval];
>Msg 6556, Level 16, State 1, Line 6
CREATE TYPE failed because it could not find type 'UDT_interval' in assembly 'UDTProj'.
Msg 6597, Level 16, State 1, Line 6
CREATE TYPE failed.
can anyone help me?
Regards.
D.M
View 4 Replies
View Related
Sep 13, 2004
I am trying to connect to a database on an MS Sql server, I typed the code exactly like what is shown in the tutorial and I keep getting an error... (Error in line 6)
Line 4: Dim oODBCConnection As OdbcConnection
Line 5: Dim sConnString As String = _
Line 6: "Driver={SQL Server};" &_
Line 7: "Server=209.151.130.8;" &_
Line 8: "Database=blah;" &_
...(Error in line 6)
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30203: Identifier expected.
View 4 Replies
View Related
Feb 19, 2007
In my project, I have added a database called aspnetdb.mdf and I store all the required information here. Now I want to write a seperate Cryatl Report for my manager, that accesses this database and display required data. This report is not a part of the asp.net project. This is only for my manager. My database is not attached to any server. I just use the attachdb in the coonection string of my project to attach this database. no I want my crystal report to access this database. If I can create an ODBC connection to this database, it will solve my problem. Dows any body know how to access this database from Crystal with or without ODBC?
Any help is greatly appreciated.
View 1 Replies
View Related
Mar 6, 2008
Hi - hope someone can help. We're creating a ASP.NET C# site that allows a user to connect to any of our 100+ SQL Servers and query a database that sits on every server. I'm trying to work out (and failing) how we can set the 'Data Source' in a connection string dynamically using the server name selected by the user in a drop down box. Any help appreciated, thanks in advance,
View 2 Replies
View Related
Dec 22, 2004
Can We Create a SQL Server connection to DB2 using linked servers?If yes, how can we do that.ANd one more thing is that my DB2 is on unix and sqlserver is on windows.
Thanks.
View 1 Replies
View Related
Mar 5, 2008
We have a mobile device project, which has a database file (Database.sdf) as part of the project.
I am trying to connect to it to insert a record. The syntax I'm using is:
string connection = @"data source=Database.sdf";
SqlCeConnection conn=new SqlCeConnection(connection);
conn.Open();
I have tried various connection strings such as
"data source=MyDocumentsDatabase.sdf";
and
"data source=C:MyProjectsThisParticularProjectDatabase.sdf"; << the connection string in teh server explorer
and
"data source=MyAssemblyName.Database.sdf";
and
"data source=MyAssemblyNameDatabase.sdf";
I've also tried getting the path the the executing assembly and adding that in, but still no luck.
but they all throw the error:
The database file cannot be found. Check the path to the database. [ File name = Database.sdf ]
I have searched the internet and found no explanation about how the path to the Database is made up (ie is it the path on *my* computer, or the virtual mobile device?) and how I can actually get the path the the database without hardcoding it.
Can anyone help please??
Thanks!!
View 6 Replies
View Related
Aug 1, 2007
Q1: Can I just open these protocols I need (see web links below) and then close them down again after SQLCacheDependency has been enabled? Note: The website (asp.net 2.0/SQL server Express) operates OK right now with asp.net - but it does not have SQLCacheDependency enabled.
Problem: When I try to do this I keep on getting this error message:
"An error has occurred when 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."
None of these 3 commands have worked (all give the same message above):
aspnet_regsql.exe -U user1 -P pwd1 -S server1/SQLEXPRESS -d myDBName -ed aspnet_regsql.exe -E -S server1/SQLEXPRESS -d myDBName -ed aspnet_regsql.exe -E -S .SqlExpress -d myDBName -ed
I am trying to run these commands via a MSTSC connection. Q2: Is that (terminal server) the problem (the "remote connection") complained of above ?
This is the command that worked on my local dev machine:
aspnet_regsql.exe -E -S .SqlExpress -d myDBName -ed
Q3: Must I really go through the procedure "How to: Configure Express to accept remote connections" at:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
I don't really want to have SQL server accepting any connections as the last time it was listening on these ports we had so many attacks being made that it was filling up the logs!
What I can't understand is that every night the database is backed up with the following command line code (operating as a Scheduled Task):
sqlcmd -s server1/SQLEXPRESS -i MW4BAK.SQL -E
Q4: So if the server is happy receiving commands from 'sqlcmd.exe' why does it have such problems with 'aspnet_regsql.exe'
Q5: If I grouped those statements I need to setup SQLCacheDependency under a Scheduled Task would they work (as there would presumably be no remote connection then) or is it something in the nature of the connection established which allows sqlcmd.exe to work but stops aspnet_regsql.exe?
View 2 Replies
View Related
Sep 22, 2006
SQL Server 2005 / .NET 2.0 Web App - SqlCacheDependency is not invalidated and I see an error sql log that occurs after the specified table changes:
2006-09-22 12:18:51.84 spid21s The query notification dialog on
conversation handle '{8D7EF5BC-544A-DB11-B6E0-000F1FD735BF}.' closed
due to the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot
find the remote service
'SqlQueryNotificationService-d61fa581-0567-43ba-991f-37499e87cbf6'
because it does not exist.</Description></Error>'.
I've read all applicable articles that I can find and applied hotfix kb916002. The sqldependency has never worked, it is not a stability issue as described in kb916002. In a trace I can see the sqldependency starts correctly. I have a console app that works fine with SqlDependancy calling same database and login creds. I don't know what to think. Calling sys.dm_qn_subscriptions show no subscriptions when this app starts as does the console app. Please advise as it looks like a broker issue.
Thanks
View 3 Replies
View Related
Oct 26, 2007
Is it possible to create a schema or table in sql server from a dbf file instead of manully creating it
Regards
Karen
View 1 Replies
View Related
Jul 20, 2005
Hi,I'm a newbie to sql server and this may be a really dumb question forsome you. I'm trying to find some examples of sql server triggers thatwill set columns (e.g. the created and modified date columns) if the rowis being inserted and set a column (e.g. just the modified date column)if the row is being updated.I know how to do this in oracle plsql. I would define it as a beforeinsert or update trigger and reference old and new instances of therecord. Does sql server have an equivalent? Is there a better way to dothis in sql server?Thanksericthis is what i do in oracle that i'm trying to do in sqlserver...CREATE OR REPLACE TRIGGER tr_temp_biubefore insert or updateon tempreferencing old as old new as newfor each rowbeginif inserting then:new.created_date := sysdate;end if;:new.modified_date := sysdate;end tr_temp_biu;
View 1 Replies
View Related
Aug 5, 2015
I need to deploy the trigger in database whenever new DB is creating on the server.
View 6 Replies
View Related
Sep 19, 2006
I am able to connect but when I try to use the advanced sql generation options the two check boxes are non enabled (generate insert, update, and delete statementsuse optimistic concurrencywhat is happening the user id has permissions to update/delete/select from the selected table
View 1 Replies
View Related
Mar 29, 2004
Hi,
platform window xp, SQL Server
I have created a new server registration called 'MASTECH'
with this registration I have created a database called 'youngerNow'
As far as I am aware, no username nor password have been created.
I wish to access the database through asp.
I attempt to create connection with below code
strConn = "Provider=SQLOLEDB; Data Source=mastech; Initial Catalog=youngerNow"
Set Conn=Server.createObject("ADODB.Connection")
Conn.Open strConn
Conn.Close
however I am getting the below error.
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'IUSR_MASTECH'. Reason: Not associated with a trusted SQL Server connection.
/younger now/books.asp, line 199
Anyway help would be appreciated.
regards
steve
View 3 Replies
View Related
Apr 11, 2008
hi how could i create my own server connection in sql 2000.i have a problem because everytime i make a new server registration it always tell that it does not exist and access denied.pls help me.
View 6 Replies
View Related
Jan 24, 2007
64b SQL2005 EE and all clent tools installed on the same server. Im trying to create a new connection in DTS Designer but after succesful test of the connection it errors out with
The new connection manager couldnt be created. Additional info : Exeption from HRESULT 0xC0010014
Any idea whats the problem here?
View 3 Replies
View Related
Dec 19, 2007
I am connecting ADAM[Active directory in application mode] using SSIS using OLEDB connection manager. I have
created SQL/LDAP query
"SELECT cn, displayName, description
FROM 'LDAP://localhost:389/O=myContainer'
WHERE displayName = 'xxx'
This query displays proper data in query builder when I run the query.But when I say OK on OLEDB source manager it gives following error
===================================
Error at Data Flow Task [OLE DB Source [1]]: An OLE DB error has occurred. Error code: 0x80040E21.
(Microsoft Visual Studio)
===================================
Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------
Program Location:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ReinitializeMetaData()
at Microsoft.DataTransformationServices.DataFlowUI.DataFlowComponentUI.ReinitializeMetadata()
at Microsoft.DataTransformationServices.DataFlowUI.DataFlowAdapterUI.connectionPage_SaveConnectionAttributes(Object sender, ConnectionAttributesEventArgs args)
Also if above query is modified to Select * FROM 'LDAP://localhost:389/O=myContainer' , it only returns adsPath.
Can anyone help what is wrong in this?
View 3 Replies
View Related