[.net] SQL Server Express Edition != SQL Server 2005 ?

Started by
10 comments, last by Alpha_ProgDes 17 years, 9 months ago
Well obviously it doesn't, but hear me out. If you've been following my database posts for the last month or so, you'll know I have been working on VS EE in C# and using SQL Server EE 2005. Now I went to a friends job and tried to run it his computer. He has VS 2005 Professional and SQL Server 2005 Professional. But he still had to download SQL Server EE 2005 for my program to work. Isn't SQL Server EE just SQL Server 2005 (Std or Pro) but stripped? Why didn't just load and run? The executable was in release mode and had been published already.

Beginner in Game Development?  Read here. And read here.

 

Advertisement
In what way did it "not work"?

One thing I can think of is that EE will set up a named instance named <machinename>\SQLEXPRESS, while Standard and Professional will default to an unnamed instance. That's still only a matter of tweaking the connection string, though. And of course the connection string isn't hardcoded into your app?
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
What about the project type? I bet the EE project type is a little different. You should try creating a project in VS 2005 and add your project files to it and then try to build it.
Hello,

I have been doing a lot with SQL too because all of our new systems are based on it. Anyway, I can bet the reason is because SQL 2005 EE only works locally. It does not have remote capabilities. Your friend I assume has it running on a server and his program connect to the server remotely, not locally.

Have a good one
Quote:Original post by Arild Fines
In what way did it "not work"?

One thing I can think of is that EE will set up a named instance named <machinename>\SQLEXPRESS, while Standard and Professional will default to an unnamed instance. That's still only a matter of tweaking the connection string, though. And of course the connection string isn't hardcoded into your app?

Well like i said above, when he ran the setup.exe the program installed but then immediately started to download SQL EE. so the person running SQL Pro, try to copy the databases and change the connection string. but the program wouldn't run. it just kept giving an unhandled exception. so finally we just SQL EE install and the program worked.

so, most likely it was hardcode. is there a way to not hardcode the connection string so it will work with SQL Server 2005: EE, Std, or Pro?

also why does it matter? if the database is with the program (.ldf, .mdb files) shouldn't it just run? as you can see i'm NEW to this.

Beginner in Game Development?  Read here. And read here.

 

Hrmm... Can you post up some of the code that you used for using Sql in your application? There may be some commands that may be specific to Sql Server EE 2k5. Did you try to use any DTS packages or anything?
We'll bring your children up in the classic English manner, by making them learn latin, and beating them half to death in a single sex environment.
http://www.gamedev.net/community/forums/topic.asp?topic_id=396087
http://www.gamedev.net/community/forums/topic.asp?topic_id=395252
http://www.gamedev.net/community/forums/topic.asp?topic_id=399568

The code I used is in there.

DTS? Uh... I don't know.

Beginner in Game Development?  Read here. And read here.

 

Quote:Original post by Alpha_ProgDes
Quote:Original post by Arild Fines
In what way did it "not work"?

One thing I can think of is that EE will set up a named instance named <machinename>\SQLEXPRESS, while Standard and Professional will default to an unnamed instance. That's still only a matter of tweaking the connection string, though. And of course the connection string isn't hardcoded into your app?

Well like i said above, when he ran the setup.exe the program installed but then immediately started to download SQL EE. so the person running SQL Pro, try to copy the databases and change the connection string. but the program wouldn't run. it just kept giving an unhandled exception. so finally we just SQL EE install and the program worked.

so, most likely it was hardcode. is there a way to not hardcode the connection string so it will work with SQL Server 2005: EE, Std, or Pro?

also why does it matter? if the database is with the program (.ldf, .mdb files) shouldn't it just run? as you can see i'm NEW to this.


if you're packaging your database with the application, then it's going to need some sort of add-on, or seperate application that can open, read, and write to the database. Since the DB was created in Sql 2k5 EE, it will then, in turn, need Sql2k5 EE to run. A DTS package is sort of like a ZIP file for databases. It generally takes a database layout, creates the necessary scripts in order to make an exact copy of your current database, and packeages them in an executable of some sort. Unfortunately, I don't believe the version of Sql Server you're using gives you the ability to create these packages, but there are third party applications out there that can help, BUT I've yet to see any that are free. I'm pretty sure the above reason is why you're having this problem, because you're trying to create a database on another computer, or you're trying to copy a database to another machine.

I've only worked with Sql Server 2k, so when it came time to install a database locally, we Would install Sql Server 2k Desktop engine on the machines, and then run the DTS package. Unfortunately, you don't have that >_<

Another thing you could check is your connection string code. If it's hard - coded, then it probably won't work, but then, it should error out when it's attempting to connect, not when it's attempting to run.

The one question I have for you right now, is that with your database files, are they supposed to be stored locally on the computer, or are they going to be copied to a different database over a network?
We'll bring your children up in the classic English manner, by making them learn latin, and beating them half to death in a single sex environment.
Quote:Original post by Alpha_ProgDes
also why does it matter? if the database is with the program (.ldf, .mdb files) shouldn't it just run? as you can see i'm NEW to this.


No, SQL Server 2005 is not designed to operate this way. Unlike MS Access and SQL Server Epxress Edition, SQL Server 2005 cannot be told to simply open a database file for an application on-the-fly. The database would have to be imported, and it would then be permanentaly hosted by that database server for anyone to access who is given security permissions to do so. This will not happen automatically unless you somehow build this into the install process. The easiest way to import it would be to use SQL Management Studio to import the database. You will probably have to set up an account to access the database as well. After that, all you should need to do it update the connection string as discussed.
Quote:Original post by nimrand
Quote:Original post by Alpha_ProgDes
also why does it matter? if the database is with the program (.ldf, .mdb files) shouldn't it just run? as you can see i'm NEW to this.


No, SQL Server 2005 is not designed to operate this way. Unlike MS Access and SQL Server Epxress Edition, SQL Server 2005 cannot be told to simply open a database file for an application on-the-fly.

Actually, it can. From here[connectionstrings.com:
// Attach a database file on connect to a local SQL Server Express instance:"Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Database=dbname;Trusted_Connection=Yes;" //   - or -"Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;"   // (use |DataDirectory| when your database file resides in the data directory) 


--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement