.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Simultaneously connecting to db with VS, website and SSMS

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

I have recently combined my aspnet membership database and main website database into one database file, I'm happy with the schemas, stored procedures etc. (This is a development project not yet a production project.)

My problem is that I can no longer simultaneously connect to the database from Visual Studio if a user is logged in to the website.



Scenario 1: No user is logged in to the website. I can go to the Data Connection window in VS, choose "Add Connection" and then inspect the contents and schemas of the database. This is fine.

Scenario 2: A user is logged in on the website. I try to connect to the website in VS and get the error:

"Cannot open user default database. Login failed. "

Scenario 3: I am connected to the database in VS and nobody is logged into the website. If someone tries to log into the website they get the following error:

Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

So it seems from the above that there can be only one connection to the database at a time? However this was not the case before I combined the membership database with the main website database. I could always make changes as a user logged

View Complete Post

More Related Resource Links

When to add "tcp:" to "Server name:" connecting from SSMS remotely

Having read in [1] that to connect to the database engine from another computer using SSMS "In the Server name box, type tcp: to specify the protocol, followed by the computer name... type tcp:<computer_name>. In our example for a named instance, type tcp:<computer_name>,49172", why do I connect to remote server without adding "tcp:"? I do not remember adding "tcp:" connecting to earlier versions of MS SQL server either... [1] Connecting to the Database Engine from Another Computer(MS SQL Server 2008 R2) http://msdn.microsoft.com/en-us/library/ms345343.aspx#otherComp

Error while connecting to Database Engine within SSMS 2008

Error text is as below:- any suggestions ?   ===================================   Cannot connect to TEJ-PC.   ===================================   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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)   ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476   ------------------------------ Error Number: 2 Severity: 20 State: 0     ------------------------------ Program Location:      at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)    at System.Data.SqlClient.SqlInternalC

Resources for soup-to-nuts of website development lifecycle



 I'm looking for a website, or book, or some resource that can lead me down the path from website design to implementation/deployment. I know that covers a ton of material, but I am really looking for the bullet points, or high-lights, to make sure that I think of everything. I am mostly fuzzy on security measures and deployment since I haven't been involved in those aspects before.

Background:  I have been a programmer for many years, and with a little over 3 years' experience coding websites in vb.net/asp.net with sql server. Due to recent restructuring/layoffs at our firm, I find myself in the position of lead IT person - I'm feeling a bit underqualified but I feel this is my chance to work hard and step up to it. I'm very good at vb.net, master pages, css, asp.net, sql server. I'm worried that the person who was the lead before was doing a bunch of stuff that I'm not aware of...so I need to start learning more than just the code. I don't need lessons on how to code anything...I need to learn how it all gets put together - the next step up.

thanks for any suggestions!

website load testing


How can i check "load testing" on my site (its using vb.net and SQL server)? Any free tool available or can it be done through windows server IIS?

Difference Btw Website vs Web application and Virtual directory in IIS 7


May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net


Thanks in Advance.


Why isn't my Views/Home/Home.Master file published when I publish my website?


Hi All,

I spent the better part of today hunting down an elusive error.  I was getting a message saying that it couldn't find the Index view for the Home controller, and it gave a list of locations it searched, e.g., ~/Views/Home/Index.aspx.  This was really confusing as the file definitely existing and was at ~/Views/Home/Index.aspx, the first place in the list of locations it searched for the view!

What I eventually discovered was that there was a file that did not get published when I used Visual Studio's "Publish" feature (this is on the "Build" menu).  That file was Views/Home/Home.master, and (as you can probably guess) is the master file used by Views/Home/Index.aspx.

Once I copied that file into place manually, it started working.  But I am left wondering--why???  Why does this file not get published?  It's a part of my project, I can see it in the solution explorer, and it's obviously a critical file that's necessary for the MVC app to run.  It has the same permissions as every other file in my project.  So why wouldn't it get copied?  And how can I fix it so it does get copied?

Thanks for any suggestions on this!


VS2010 Professional .NET 4.0 Remote Debugging ASP Website Project


Trying to remote debug ASP website from VS2010 Pro to Windows Server 2003 machine.  Specifically, trying to debug a Web Service, but breakpoint says, "The breakpoint will not currently be hit. No symbols have been loaded for this document."  This happens for all compiled code though.  I have read this is due to missing PDB files and the work around is to manually copy them, as noted here.  Problem is, I cannot find any PDB files for my project, except referenced libraries, which I can remote debug.


  • web.config has <compilation debug="true">
  • Debugger is attached to wewp.exe process on remote server
  • Installed VS2010 remote debugger from DVD (as I can remote debug referenced libraries)

This is beyond frustrating.  I migrated my code from VS2008 .Net3.5 to VS2010 .Net4.0 to take advantage of the inherent multithreading framework.  Debugging works when using local host and was stable until deployment to test server.

Thanks in advance,


Connecting to MS SQL Server database using webmatrix.



I am novice  user to raizor syntax using webmatrix and i am trying to connect MS Sql server database (instead of using .sdf file i am using .mdf file) using the tool webmatrix for startersite.

The connection string that i setup as follows.

<?xml version="1.0"?>


        <compilation debug="false" targetFramework="4.0" />
    <add name="OESConnectionString" connectionString="Data Source=.\SQLServer2005;AttachDbFilename=|DataDirectory|\OES_Data.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />


And i am using websecurity helper as well and the setup is as follows.

WebSecurity.InitializeDatabaseConnection("Data Source=INLTE5556\\SQLServer2005;Initial Catalog=OES;Integrated Security=True", "System.Data.SqlClient", "UserProfile", "UserId", "Email", true);

When i am trying to insert the user details into database i am getting the below error.

Format of t

Creating a user friendly alias for the website path


 Hello mates,

I am hosting my ASP.NET application on a Windows 2003 Server.

To browse to my application one has to type the path :http://serverName/applicationName

I want users to only type  applicationName on the web adress area.I believe there is something to do with alias and CNAME on DNS records that can adress this.

Any help on how to go about doing this will be highly appreciated.

Change Button Text in Multi Language Website


Hi i developing multi language website

using Master pages

everything fine

Page_Load i set the Text property of Button Control from Resource file

like this

Button1.Text = GetLocalResourceObject("Button1")

then in the button click event i cnage the text of the Button control

Button1.Text = GetLocalResourceObject("Button1_new")

but the text doesn't change and no error messgae

what is the problem how to solve this


How can my website support Arabic?




I have a website and now need it to support Arabic.

It uses visual studio 2003 and .net 2.

I have tried a very simple thing which was to copy some Arabic text to display on the webpage. I saved the page as Arabic (windows) - codepage 1256 and when I ran the page the text wasnt displayed properly.

Please can someone point me in the right direction as to how i can get the ball rolling on this?


Many thanks

For Multi-Language website which process is better in asp.net


 I want to build multi-language website in asp.net 2008 and asp.net 2010. So, which process is better for building application? Using either Local and Global Resource or New Folder to make separate according to language?


Application performance should be good and also easy manageable.


Please suggest me in which way I will build the application either using resource or folder. If there is any other better solution then please share.

Citrix server slowing down due to ASP.NET Website



I have created an ASP.NET website using Visual Studio 2008. It is deployed to a local server in my office running Windows Server 2003. This intranet website is accessed by about 200 employees at a given time from 3 different corners of the world.

It runs fine on a local browser. But it is terribly hogging about 25% of the CPU memory when run in a Citrix environment. It runs in the IE 8 with IE 7 compatibility mode.

Many users open two browsers at a time to run different pages of this website.

The webpage has AJAX toolkit controls and lots of CSS defined.

Does anyone have any idea or experience regarding this?


how to create a mobile version of a website?


 how to create a mobile version of a website?
Is there any server support needed?
How does the browser detect whether the url is accessed via mobile device or a PC?

Configuring website to ASP.NET 2.0 failed. You may need to manually configure this site for ASP.NET


I am trying to create a new website project in Visual Studio 2005, the website is an IIS website (ie. http://localhost/website1) and i get the following error message;

Configuring website to ASP.NET 2.0 failed. You may need to manually configure this site for ASP.NET 2.0 in order for your site to run correctly.

then when i try to debug the project i get the following error;

Unable to start debugging on the web server. The server does not support debugging of ASP.net or ATL server applications.

I am running Windows XP professional, with .NET 2.0 installed, and IIS V5.1

How can i get a simple website to debug on my machine?

VB webform in IronPython asp.net website


Hi, I tried to bring a previously done webform made in vb.net to an IronPython asp.net website with no luck. After seeing it didnt work, I tried to write the simplest codebehind vb.net webform to see if there was a problem with vb.net in an IronPython website and I got the following usual error "be sure that the defined class in this file matchs with the one in the attribute inherits and that it extends the right base page (page or control)" (sorry if the translation isnt the most accurate I get that message in spanish) but if I create a vb.net webform in the same website, with the sourcecode in the same file (with the vb.net code between script runat="server" tags in the same page) I get no problem. Do I have to configure something for both kind of sourcecode languages to run in such way in the same IronPython website, like configuring something in the webconfig file or is there some compatibility issue for doing that which can't be resolved?

I figured out that in some cases I can solve it by creating the app_folder and moving the vb files there, but if these files dont inherit other classes which are in the app_folder

On page loading or executing all CSS flags are ignored and website is plain without formatting


 My problem is whenever i execute my app the first page that loads is the login page pointed to by my web.config file forms authentication, this page is meant to show CSS formatting for the info i am displaying but it is not. Any help with this problem would be great. A cut and paste of my problem is shown below as you can see there is no CSS.

jsfdnjldfngjfg here it is

Account Login
User Id:
Forgot Password?

I have inserted all the link as in:




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend