Programming without a DB - linq-to-sql

I have a project to work on. The project requires SQL server. I am using LINQ. So since I dont have SQL server installed on my computer, is it possible I can just use the LINQ designer to create my classes? And then when I do publish my website to a online hosting company, I can use the LINQ to create the tables and stuff?
Is this overly complicated? I want to stay away from using SQLite, or SQL Server Express or SQL server compact because its hard to transfer stuff. Atleast for me. My one problem is also that I want to use ASP.NET Membership stuff. If I run the .exe tool to automatically create my tables, how would I accomplish this without using a db? I tried using SQL server compact (mdf file i think?) but apparently the tool does not support it.
So what are my options here. I'd like to being programming right away however paying for hosting online is just a waste of money for me right now until i have some of the project done.

I'd suggest installing SQL Server Express Edition on your computer and using that as your database during development. I know that there can be some confusion and difficulty when upgrading your development database from SQL Server Express Edition to the professional edition on the hosting company's database servers, but I'm confident that the time you will need to spend on that will be dwarfed by the time you'd need to spend to build and use a mock database layer, not to mention the extra testing you'd need to do once you moved to a real database.
Also, the challenge in moving from SQL Server Express Edition to the professional edition at the hosting company shouldn't be too bad if you choose a web host that has tools for importing your SQL Server Express Edition database into their database server. (Some have it so you can just upload your SQL Server Express .mdf file and it will automatically import it into their database server.)

Two things you can do
Install Sql Server Express on your development machine (or a server on your LAN). This way you will have a local database to develop and test on.
Not necessary, but you "could" try to use Entity Framework in place of LINQ, and use Code First mapping.
Also with Sql Server Express, you can do a lot of your database work right from Visual Studio (providing you're running VS Pro).
I want to stay away from using SQLite, or SQL Server Express or SQL server compact because its hard to transfer stuff. Atleast for me.
Upgrading shouldn't be too difficult.
My one problem is also that I want to use ASP.NET Membership stuff. If I run the .exe tool to automatically create my tables, how would I accomplish this without using a db? I tried using SQL server compact (mdf file i think?) but apparently the tool does not support it.
aspnet_regsql.exe works on Sql Server Express

Use SQL Server Express. It is free. Easy to install in your development environment. In SQL Server Management Studio (SSMS), you can right-click on a table and generate scripts to create the table if you did this from the graphical designer. All you have to do is run the script on the new server. There are free tools that can create/transfer data as well.
What are you going to do down the road when you need to test changes? I hope you don't plan on using the production database.

Just generate your entities by hand, later you would be able to easily attach SQL Server to all this stuff.
Create classes and mark them with required attributes (I don't remember their exact name,check MSDN)
P.S I just can't believe SQL Server Express is not enough for you )

Related

Deployment of Access SQL database to SQL Server

I know I'm asking quite a large question in scale here, but I'm looking more for some general guidelines.
At my work, I have the skeleton of an MS Access database that is ~50% completed. The scope of the project, however, is growing larger and larger as we plan for it more.
I am comfortable in HTML/CSS and Javascript, but have never done any SQL Server back end type stuff - but my question is: what is the process of deploying this access database to an online database? What are some guidelines, links, or guidebooks I can look into for this?
You should definitely check out the upsizing wizard information on https://support.office.com/en-us/article/Move-Access-data-to-a-SQL-Server-database-by-using-the-Upsizing-Wizard-5d74c0df-c8cd-4867-8d07-e6e759d72924.
Use the upsizing wizard with a test SQL Server instance and see how it works. If you need a different tool, SQL Server's import/export tool will work great to migrate your databases over to SQL Server. Use this documentation for that: https://msdn.microsoft.com/en-us/library/ms141209.aspx
There are many YouTube videos that you can watch prior to migrating to SQL Server also: https://www.youtube.com/results?search_query=migrate+access+to+sql+server&page=&utm_source=opensearch
Sql Server has an import functionality that allows you to import from other ODBC drivers, text files (csv), and Access. If you have access to the SQL Server management studio then you'll be able to do this. If not, then you can always download the express version locally, import your access file, then export (dump) your sql server database, and then upload/import it to your server.
My recommendation, if you see yourself expanding away from Access then do it now rather than later. You will most likely run into minor details to fix which are better off sorting early than later in the project when it's close to release. The express version should help with local development.

Windows App with mySQL Backend

I am trying to design a database application for my small business. I've created a number of form driven MS Access databases for use before but would like to create a permanent solution in something more advanced & common.
I was thinking of using mySQL for the database and would then program a C# or VB application to be used in Windows. I do not want or need a web based version at this time but the migration to VB.net in the far future may be something I'll look into.
I know I can use a MS Access backend for my windows application without having to install MS Office on any or all the computers the program will be run for.
But here is my question. Is it necessary to install mySQL Server on the PC hosting the database, on all the PCs accessing the database or can I just use the database file as the backend and Visual Studio will have all the necessary tools I need to access it?
If I have to install the server I may just stick with the MS Access database as the needs for an excessive amount of database storage won't ever be an issue.
You'd need to install MySQL server on the Server hosting the database. The clients would then connect via the network. You will however need a driver to access the MySQL-Server with VB.NET on the client machines. A simple DLL-File might be enough, though.
If you are looking for a file-based database solution have a look at SQLite. But you will have to watch out for concurrency issues here.

Create Database in SQL Server 2012, Script and Use in 2008?

If I create a database using 2012 and work and add that info to it, if I were to script the database after, would I be able to run the script in 2008 and have everything work A.O.K?
If you are using SQL Management Studio, you can right-click on the database name, then select Tasks → Generate Scripts.
Here you will be able to create scripts to script out the Schema, Data, or both Schema and Data, and if you click the Advanced button, you can specify which version of SQL Server you'd like to target.
So, simply choose SQL 2008 as the destination server and you should be good to go!
A script? Yes. Well, let me rephrase: it depends. As long as your objects don't use any 2012-specific features, you will be able to script out the schema using Management Studio or a variety of 3rd party tools (I blogged about some options here). Many of the tools also offer options (or companion tools) to also script the data.
The problem is there isn't a very easy way in SQL Server 2012 to identify all of the places where you might be using 2012-specific features. For example, I don't know of a tool that will inspect your database and point out that you are using the FORMAT() function, which is not available in SQL Server 2008 or 2008 R2.
Other means of copying the database over - backup/restore, attach/detach, mirroring/log shipping etc. will not work. You can go up (from 2005, 2008 or 2008 R2) to 2012, but you can't go backwards.
So in general I agree with John. Much safer to develop on a version <= deployment version. Why would you want to develop on 2012 to deploy to 2008? Seems quite risky to me.
If you have very large amounts of data to move (gigabytes) then the TSQL scripts that the SQL Management Studio will generate for you could give you problems because of the sheer size. A better alternative would be to use BCP (Bulk Copy Program). The downside is that this is a command line utility and requires more work than just using the wizard.
As luck would have it somebody has written something which looks remarkably like the wizard only using BCP. It is the SQL Database Migration Wizard and is freely available on Codeplex - http://sqlazuremw.codeplex.com/releases/view/32334. Originally intended as a database migration tool between SQL Server and Azure you can just as easily use it between SQL Server and SQL Server. The key is to go into the advanced options (similar to the Management Studio wizard) and pick SQL Server. Later when you are prompted for the target system choose your 2008 installation.
I had no 2012 specific artefacts in my database and it worked very smoothly for me.

Sql server version error...655 version needed but you computer has 612 or earlier version ? error

Hi i have a error like " dbFileName cannot be opened because it is version 655. This server supports version 612 and earlier. "
what should i do ? some friend of mine done a project but i guess he done it with sql 2008 and i have sql 2005 is that the reason why i got this error? can i fix it ? if i setup a newer version of sql does it will solve the problem?
www.microsoft.com/express/Database/default.aspx#Installation_Options here sql server 2008 R2 express is available can it be the solution?
thank you...
by the way i found a link of an update http://www.microsoft.com/downloads/details.aspx?FamilyID=E1109AEF-1AA2-408D-AA0F-9DF094F993BF&displaylang=en is this a solution to my problem ?
The VS update in the link is not a solution to your problem. You'll need that update though if you want to use VS to work with a SQL Server 2008 project. And you will have to work with SQL Server 2008 if you want to use your friend's database. To solve your problem you'll need to upgrade to SQL Server 2008. Express edition is fine, as long as the database is less than 4Gb in size. Note that if you continue to work on this database, you won't be bale to deploy your solution to a hosting that is based on SQL 2005, since they won't be able to use your database.
But the real problem you face here is the fact that you treat MDF files as source. You should develop exclusively using T-SQL scripts to deploy your database, and then you won't have any of these problems. You can use a application versioned schema deployment strategy, or you can use a Visual Studio Database Edition project and deploy using vsdbcmd.exe and .dbschema files. Any of this solutions will be way ahead of actually checking in MDF files, exchanging MDFs between team members or copying MDFs at deployment time.
SThe database has been attached to a sql server 2008 instance. You cant attach it back to a sql 2005 server. ee this link for more details:
http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/01ed3b1c-6f29-4518-a3a4-e4e35decc05f
You can download an express version of Sql Server 2008.
You won't be able to open it without installing the same or later version that was used to create the file; you can use the free SQL Server 2008 Express Edition if it the database is not too large.

is it safe to install mySQL on windows server 2003 when MS SQL 2005 express already exists?

[edit]
I should note that I need to do this on a live production server. The MS SQL Server is already attached to our website and supports a 3rd party ERP package. I want to set up a separate database that I can code against for some auxiliary pages and internal-use apps) which will be completely independent (mostly for security, but also because I prefer mySQL) from the ERP solution.
[end edit]
The MS SQL 2005 express db is already installed and in use, so I don't want to hose it.
Will this create problems, or have you done it successfully?
Aside from performance issues, assuming they're both continuously used, there shouldn't be a problem.
For a development machine this is safe to do. The two database servers listen on different ports, so there is no problem of running both at the same time.
I wouldn't recommend it though for a production system.
Like Assaf said, the only thing you should worry about are possible performance issues with both database services getting run at the same time. Other than that you should have no worries concerning the integrity of the two. They are completely separate and should not have any sort of conflicts.