SqlSiteMapProvider ConnectionStrings Help!

Apr 20, 2006

When I run my project it fails on SqlDependency.Start(_connect) with message:

An attempt to attach an auto-named database for file D:WINDOWSMicrosoft.NETFrameworkv2.0.50727ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

 

<?xml version="1.0"?>

<configuration>
 <appSettings/>
 <connectionStrings>
 
  <add name="SiteMapConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory| est1.mdf;Integrated Security=True"
   providerName="System.Data.SqlClient" />
 </connectionStrings>
 <system.web>
  
  <siteMap enabled="true" defaultProvider="AspNetSqlSiteMapProvider">
   <providers>
    <add name="AspNetSqlSiteMapProvider" type="SqlSiteMapProvider" securityTrimmingEnabled="true" connectionStringName="SiteMapConnectionString" sqlCacheDependency="CommandNotification"/>
   </providers>
  </siteMap>
  <caching>
   <sqlCacheDependency enabled="true"/>
  </caching>
  <compilation debug="true" strict="false" explicit="true"/>
  <pages>
   <namespaces>
    <clear/>
    <add namespace="System"/>
    <add namespace="System.Collections"/>
    <add namespace="System.Collections.Specialized"/>
    <add namespace="System.Configuration"/>
    <add namespace="System.Text"/>
    <add namespace="System.Text.RegularExpressions"/>
    <add namespace="System.Web"/>
    <add namespace="System.Web.Caching"/>
    <add namespace="System.Web.SessionState"/>
    <add namespace="System.Web.Security"/>
    <add namespace="System.Web.Profile"/>
    <add namespace="System.Web.UI"/>
    <add namespace="System.Web.UI.WebControls"/>
    <add namespace="System.Web.UI.WebControls.WebParts"/>
    <add namespace="System.Web.UI.HtmlControls"/>
   </namespaces>
  </pages>

  <authentication mode="Windows"/>
  
 </system.web>
</configuration>

View 2 Replies


ADVERTISEMENT

How Do You Refresh Menu When Using SqlSiteMapProvider

Jun 23, 2005

I followed an article which was recently published by Jeff Prosise in his "Wicked Code" column in MSDN magazine and I was able to make it work.My problem is that I do not know how to refresh the menu. If I add new record in the sitemap table what needs to happen to refresh the menu.  

View 2 Replies View Related

App.config And Connectionstrings With Several Databases

Nov 20, 2006

Hello all
I need to know the best way to work with databases (Sql Server) in my app.config.
I have an VB application that binds data from a SQL server (All Customers install these application and retrieve data via VPN). I use two databases for each customer. The first DB has some commun tables/data and the second one is its ID (Until now I setup manually the connections because we don't have more that 10 Customers but we need improve that for next year). I know that a connection string is created in the app.config file . 
I don't know if it is possible from this way or if there is another way to do it.... but the goal is:
1. Customer is logged in the application -User Name, ID, Password
2. Customer retrieve a database with commun data and his own database (that is his ID). (From the app.config???) How can I setup my app.config in order that every customer retrieve his database automatically when it is logged?
Thaks, I don't know if it's clear but I didn't find another way to explain my trouble 

View 1 Replies View Related

Need Help - ConnectionStrings In Web.config File

Jan 3, 2007

I think I've read to many post and now I'm confused on what the exact syntax should be and where in the web config file for connecting to my remote database on the web. I have a SQL Server 2005 database on the web.  It was imported by the host from the members ID and passwords database created in Express 2005 from the ASP.Net configuration
Here's the portion of the config file:
<configuration>
<appSettings/>
<connectionStrings/>
 
 
<system.web>
Here is the sample connection string my host provided:
DRIVER={SQL Server};SERVER=sqlserver5.loosefoot.com;UID=myadmin;PWD=Your Password;database=eldersmembers
Would someone show me exactly what and where the syntax for the connection string goes?
Thanks in advance

View 8 Replies View Related

&<ConnectionStrings&> Error Message

Apr 12, 2007

I have one SQL Database and I am getting the an error message when debugging.  The error messasge points to the ConnectionString.  Any Ideas would be helpful.
 Rick
<connectionStrings>
<add name="sqloledb" connectionString="Data Source=mssql09.1and1.com,1433;Database=xxxxxxxx;UserID=xxxxxxxx;Password=xxxxxxxx;Trusted_Connection=False" providerName="System.Data.SqlClient" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=mssql09.1and1.com,1433;Database=xxxxxxxx;UserID=xxxxxxxx;Password=xxxxxxxx;Trusted_Connection=False" providerName="System.Data.SqlClient" />
</connectionStrings>
 

View 2 Replies View Related

Using Web.config ConnectionStrings And SQL Server

Mar 9, 2006

Greetings,
My connection string looks like this (in the web.config) and is used with many data controls in my application:
<connectionStrings><add name="connection_NAH" connectionString="Data Source=NAH;Initial Catalog=NAH;User ID=xxxx;Password=xxxx" providerName="System.Data.SqlClient" /></connectionStrings>
I'm using vb.net and my code looks like this:Dim myConnection As SqlConnectionDim mySqlCommand As SqlCommandmyConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("connection_NAH").ConnectionString)mySqlCommand = New SqlCommand("UPDATE tbMasterOption SET ImageURL = 'test.gif' WHERE ID = 116977")Try            myConnection.Open()            mySqlCommand.ExecuteNonQuery()Catch ex As Exception            Label3.Text = "Couldn't update database record: " + ex.ToString()Finally            myConnection.Close()            Label3.Text = "Closed db connection"End Try
------------------
The only output I get is from the label3 which says "Closed db connection".  Doesn't look like any exceptions are thrown but when I look at the database the record is not updated.  Originally I thought my SQLConnection was not constructed correctly but I also tested it by outputting the connection string to Label3 which looked fine.  The only other thing I can think of is in the use of ExecuteNonQuery().  Is this the right method or do I need something else? Running the sql query manually works...
Thanks in advance..

View 2 Replies View Related

Web.config, ConnectionStrings And SQL Named Instances Over A VPN Connection

Aug 29, 2007

Ok, here's the deal. This has been killing me for months now.

Here's the setup - SQL 2000 database on a Shared Infrastructure (cluster). I have a database on a named instance. My port number is xxxxx. I have dbo (through Windows Auth) permissions on my database. When I connect at the office, I get through fine, no question. When I connect at home, I get error 26 in my asp.net 2 app (using System.Data.SqlClient), cannot find SQL Server database. I can connect through the SQL 2005 Management Studio using the same servernameinstance name I use at the office. I can connect through the SQL 2000 Query Analyzer using servernameinstancename;(semicolon)portnumber. I've tried all sorts of combinations in my web.config -
servernameinstancename,(comma) portnumber
servernameinstancename;(semicolon - causes web.config to blowup) portnumber
ipaddressinstancename, (comma) portnumber

and i still get nothing. usually it's 'error 26' - but if i use this:


Data Source=ipaddressinstancename,portnumber;Network Library=DBMSSOCN;Initial Catalog=xxx;Trusted_Connection=Yes;

I get 'Login failed for user domainuser'

I've tried making an alias. I've tried using ODBC. I've even tried a freakin' DSN. No dice.

Nothing seems to work - I'm at the end of my rope. Can someone please help?

View 4 Replies View Related

When To Code 'providerName=System.Data.SqlClient In ConnectionStrings, Or Not To?

May 31, 2008

Yesterday, in response to an error msg (something like Login failed for user ''), I deleted the 'providerName=System.Data.SqlClient'in my connectionStrings from Web.config.  Then the aspx website worked.I understand that the value "System.Data.SqlClient" specifies that ASP.NET should
use the ADO.NET provider System.Data.SqlClient
when making a connection.  Why deleting providerName solved the error?  Jeffrey 

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved