Showing posts with label major. Show all posts
Showing posts with label major. Show all posts

Friday, February 24, 2012

ASPNETDB Connection Problems - Please Please Help!

Hi I am working on my final year project and after over coming one major problem with sql server I have encountered another.

It feels as if I have tried everthing to solve it but cant get my head around it. I really do not have much time left to finish my project and am very worried in case I cant get the app / db fixed in time.

The problem started when I was showing my friend the website over the internet. There was a space in the address / folder name so I decided to create a new folder and copy the contents of the code from the old folder to the new one. This included the app_data directory that holds the databases for my system.

After setting up a virtual directory in IIS v 5.1 i ran the website only to be confronted with not being able to log in.

I have three connections ..... aspnetdb.mdf, x.mdf, y.mdf.

x.mdf and y.mdf are both being read from ok when I run the app but it doesnt seem to be reading from the aspnetdb.mdf database.

I have tried all sorts of things and had all sorts of error messages including:

cant write to database as its read only

cant access database because its already there.

It seems to me that there is more than one aspnetdb.mdf file attached therefore the app is reading from the new one and not the one i want it to.

I will paste the web.config file below. Please note that before i copied and pasted code to a different location this web.config was working fine. Also note that when I hit ctrl+alt+del it shows up 3 sqlservr processes -

sqlServr.exe - Network Service
sqlServr.exe - Rodney (my log on name)
sqlServr.exe - ASPNET

<connectionStrings>

<add name="Classes" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Classes.mdf"

providerName="System.Data.SqlClient" />

<add name="Iftams" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Iftams.mdf"

providerName="System.Data.SqlClient" />

<remove name="UsersDB" />

<add name="UsersDB" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

I have tried reinstalling sqlserver, creating a new website from the vs2005 ide and also creating a virtual directory first and then copying files to it.

I have also tried attaching to management studio, changing user settings etc

I really dont know what to do next. My head is fried. Please help.

I would really appreciate your help on this one.

Regards in hope

Rodney

The ASP.net forum is a better place to ask questions about ASP.net and Visual Web Developer. You can find all the forums at http://forums.asp.net/ and the forum that is specifically about SQL Express in VWD at http://forums.asp.net/54/ShowForum.aspx.

Regards,

Mike Wachal
SQL Express team

-
Check out my tips for getting your answer faster and how to ask a good question: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=307712&SiteID=1

Thursday, February 9, 2012

ASP.NET + SQLServer Data Mixup

I've created a ASP.NET site using a SQLServer database hookup, and after creating the project with minimal errors I have run into a major problem. The site is made to be used by multiple users using Update and Select commands at the same time, but I have found that, when multiple users are using the site at the same time, (20+) the data seems to be going to the wrong people.

For example, user 1 was recieving user 2's data. The code works fine with 1-5 users on at once, but seems to have this problem very frequently with more than that. The computers that were being used at the same time were all in the same room, under the same LAN domain, with very similar computer names (ABCD-101-XX where XX is the computer number). I was wondering if this could be the problem, if the computers are in escence waiting for their data, and just steal the first piece of data they can find.

This seemed to happen when the users were performing the same query at the same time, so the data was in the right place, it was just someone elses data.

Any help would be greatly appreciated.Are you storing any data in the Application state or in Cache? These locations are shared between all users and you will definitely get incorrect results. Do not ever share connection or command objects in a global fashion.|||No, I havent been storing any data in the Application state or in the Cache, so that cant be a problem. If anyone out there has experienced this problem before or may know of some sort of a way to fix this, any help would be greatly appreciated.|||A week later and this problem still exists, anyone have any sort of a solution??|||This isn't really a SQL Server/MSDE issue. You might have better luck in the Data Access forum.

And no, I've never seen this problem before, on any platform. My gut feeling is that it's a hardware/LAN issue.

Terri|||Could you share your code with us? I expecte there is concurrency problem in your
Update and Select commands

where I assume you didn't put these two statements within one transaction.