SQL Server Connection in ASP.NET

Posted by Nurasto | January 29, 2008 | Software and Web Development | 0 Comments

I choose to write in English because seems many people held problem like I do. I had problem with SQL Server 2000, SQL Server 2005 (Express) in regular basis. I had some thought that the problem related to :

  1. Permission
    Please check your APP_DATA and APP_CODE folder permission, make sure it contains ASPNET and NETWORK SERVICE. Don't add all just try one by one, if you failed on ASPNET user then you could check NETWORK SERVICE also.
  2. Web.Config Setting
    If you want your DATA stored on APP_DATA make sure had correct connectionString (this just example), change the necessary configuration according to your machine and SQL Instance

    <add name="DintCoreDB" connectionString="Data Source=DINT\SQLEXPRESS; AttachDBFilename=|DataDirectory|DintCoreDB.mdf; Integrated Security=true; User Instance=true"/>

  3. SQL Server it self
    SQL Server 2005 with Advanced Service had tricky configuration and it will make a headache, make sure you install this first before all things like Visual Studio. Replacing old instance could direct you into big mess which APP_DATA can't work properly. I don't know why this happen. I keep safe for this one as I don't have much time to experiment.

Hope this works. Laughing

Sorry, comments are closed

Bit and Bytes

Hello. My name is Dityo Nurasto. I am working as freelance software and web developer.

This is my personal playground. Enjoy your stay and don't hesitate to send comments.

ShoutBox