How to know the database version of .ldf and .mdf & how to connect ASP.NET website with SQL server 2005 express edition

.NET fW 3.5 , ASP.NET , Visual Studio 2008 , SQL Server 2005 Express ed. Pune, India
  • 10 years ago

    I just wanted to know the following things if u can just help me.

    I made a website in Visual Studio 2008 and used the database provided by the VS [I dont know which version is this].

    That website runs successfully on the machine having visual studio[As in that i just attach my database through the GUI provided by VS].

    Now I want to deploy that website on a LAN. I have the database in .ldf and .mdf format. But I dont know whether it is in sql 2005 or sql 2008[as i made it through Visual Studio GUI]

    Now the system in which i have to deploy cannot have a licensed product. So i have to convert that database either to open source or an free version of sql server.

    I chose to go for SQL Server express edition that is free. Now the prolem being whether I use SQL Server 2008 or 2005 as i dont know which database was provided by the VS.[when i made that databse]

    But the problem being that on the system in which i have to deploy does not contain VS.

    Supposing it provides SQL Server 2005 express edition I permormed the following test:-

    Now i have installed .NET framework 3.5, MS SQL server 2005 Express Edition and the SQL Server management studio that is a GUI for handling d/b. Now when I attached that database[that i have, of which i dont have the version]. I can see the database and tbles and all the contents that was there in the d/b.[through that management studio GUI].

    Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-

    1> The database that i have is in SQL server 2008 express edition or something else. 2> I have to make some changes in the connectivity[in web.config or some other location]

    NOTE: Also when i connected the d/b in management stuio it shows all the tables with dbo as a prefix. for eg. suppose i had a table as UserMaster than its showing as dbo.UserMaster.

    please guide me if u can. Waiting for ur reply.

  • 10 years ago

    hi there, the sqlserver that comes with vs2005 and vs2008 is sql2005 express edition witch you can attach its databases to all versions of sql2005 and above, then this problem is about the connection string itself, you need to make a userid and password on sqlserver or use the internal userid 'sa' instead of windows authentication.

    a simple connection string: "packet size=4096;user id=SA;data source=MYSERVERNAME;persist security info=True;initial catalog=MYDATABASE;password=MYPASSWORD"

    p.s. generaly, you have to encrypt connection strings to protect against hackers attacks.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr