I have a winform project using LINQ 2 SQL as data access. I want to move the SQL Server database to the SQL Azure. Is there any problem with my data access, specifically L2S or I have to rewrite the data access using e.g. EF 4? I guess this should work only with changing the connection string?
Thank you!
Linq to SQL is fine and will work against SQL Azure. EF 4 will work too. However keep in mind that regardless of the tool you use you will need to account for connection retries, or connection loss in the middle of an operation. See this article for more information on how to handle this issue:
http://blogs.msdn.com/b/cesardelatorre/archive/2010/12/20/handling-sql-azure-connections-issues-using-entity-framework-4-0.aspx
Also, more information and a complete list of possible connection loss and error codes to trap can be found here:
http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-connection-management-in-sql-azure.aspx?wa=wsignin1.0
Hope this helps.
Related
I have been tasked with migrating an existing MS Access database to SQL Server 2012. It appears that using the SSMA for Access is the best choice for completing this migration. I have done some review of the migration assistant and it seems to be pretty straight forward. The kicker is that this client wants to use the existing Access forms with the data that has been migrated to SQL Server. So once the migration is complete, I need to point all of the current Access forms, queries, and reports at the new data source. I am not sure of the best way to accomplish this. I see that there is an option to 'link tables' when using the migration assistant but I am guessing there is more work to do to get the entire access front end working with the SQL backend. I don't have much Access experience so any help or advice on the best way to accomplish this would be much appreciated. Thanks!
The SSMA tool can also redirect its table definitions (the entries under the 'Tables' tab in the database window) so that they reference the migrated data in SQL Server. Forms, queries and reports all use these table definitions, so you may well find that most things work as expected immediately after migration. However, there are some aspects that do not move successfully, and you are likely to hit some of these if there is much VBA code in your application.
I had to provide a web application creatde in ASP.net and C# to my client. After some time he wants to make changes in that product. I have to update in code and database. So please provide some idea or guidance that how to compare the database using SQL Server 2008.
Or can I do this with other software?
I have googled but I got not enough satisfaction. Thanks...
We use SQL Compare by Redgate.
It's very easy to use - it will show you the differences between two databases and allow you to select which objects you want to synchronise. A synchronisation script is then generated that you can run on the target database.
Easy peasy!
i am new to windows phone 7 and im just looking for some information in regards to databases.
I understand that we can use SQLce to store a database, i've got some idea on how to create one, at the moment i was wondering how to have prepopulated data when a app is loaded?, ive heard about sqlmetal is that a way of creating a database and addinbf data?
Also When i have a database on a mircosoft sql server, is it possible for SQLce and SQL server to pass data between each other i.e hold the same database with same data?
Also i believe that i must have a webservice for the phone to connect to the webserver how would i apporach this? would i use httprequest to connect to the webservice then the webservice connect/interact with the webserver what code would the webservice be written in?
Any links would be a great help
Sorry if its long winded
Thanks
There are some good tutorials available for how to use SQL CE - e.g. http://www.windowsphonegeek.com/tips/Windows-Phone-Mango-Local-Database(SQL-CE)-Introduction
For a pre-populated database, you might also want to check out http://blog.arsanth.com/?p=343
For synchronising databases and supplying a web service - I think this is for you to code - maybe consider an odata service - http://msdn.microsoft.com/en-us/data/aa937697
There are alternatives to sqlce - in particular at least a couple of sqlite ports and some wp7 specific stores like Stirling
It might be an idea to try starting on something and then come back to StackOverflow when you hit specific issues/problems.
Your SQL CE file can be shipped as part of your app. Set the df file to COntent in the Solution View and create a DataContext with the appropiate connection string. MIne looks like
DataContext ctx = new DataContext("Data Source=appdata:/DataModel/Database.sdf;Mode=Read Only")
To create Have a read through Converting SQL Server database to local C# database and it points to http://www.codeproject.com/Articles/25685/SQL-Server-to-SQL-Server-Compact-Edition-Database to create a SQLCE database from SQLServer database.
In most cases you don't need a relational DB
Maybe you should look into Sterling, Raven, fileDb or any other nosql that suits for silverlight
Is there seriously no way of using a shared access non-server driven database file format without having to use an SQL Server? The Entity Framework is great, and it's not until I've completely finished designing my database model, getting SQL Server Compact Edition 4.0 to work with Visual Studio that I find out that it basically cannot be run off a network drive and be used by multiple users. I appreciate I should have done some research!
The only other way as far as I can tell is to have to set up an SQL server, something which I doubt I would be able to do. I'm searching for possible ways to use it with Access databases (which can be shared on a network drive) but this seems either difficult or impossible.
Would I have to go back to typed DataSets or even manually coding the SQL code?
Another alternative is to try using SQL
Install SQL Server express. Access is not supported by EF at all and my experience with file based databases (Access, SQL Server CE) is mostly:
If you need some very small mostly readonly data to persist in database you can use them (good for code tables but in the same time such data can be simply stored in XML).
If you expect some concurrent traffic and often writing into DB + larger data sets their performance and usability drops quickly. They are mostly useful for local storage for single user.
I'm not sure how this relates for example to SQLite. To generate database from model for SQLite you need special T4 template (using correct SQL syntax).
Have you tried SQLite? It has a SQL provider, and as far as I know EF supports any provider. Since it's file-based, that might be a plausible solution. It's also free.
Microsoft Access is a slick way to access data in a MS SQL Server backend database, but I've always had problems accessing (so to speak) large tables of data, especially when trying to toggle between results and design mode in Access.
Access gives me a number of nifty things, not the least of which is Crosstabs, but this hung connection to the server drives me a little crazy!
Does any MS Access gurus know how to optimize the ODBC connection so it isn't doing what appears to be full table scans when I just want to tweak and build my queries?
The ODBC driver will pass as much work as possible to SQL Server but as soon as you use a vba function like Nz or non-SQL Server syntax like PIVOT then the ODBC driver must pull back more data and indexes to get the work done on the client side.
As per other answer either build your views in SQL Server and link to the views or else use an Access Data Project.
NB: PIVOT queries with unknown number of columns cannot be handled in SQL Server in the same way that Access will do this natively - so if you run a pivot in Access against SQL Server data you will likely pull the whole table back. Pivot queries must be built in SQL Server using dynamic SQL techniques or else pre-saved views that have all the columns hard coded. Check out this link for one way to do this:
http://www.sqlservercentral.com/articles/Advanced+Querying/pivottableformicrosoftsqlserver/2434/
As others have said, the only way to improve performance on large tables is to have the SQL Server database engine do the work for you. A method of doing this which hasn't been mentioned is to use a pass-through query, which will enable you to keep all your code in MS Access, without having to create objects on the SQL Server:
http://support.microsoft.com/kb/303968
You will have to write SQL Server T-SQL rather than the Access dialect; however, SQL 2005 (when running in compatibility mode 90) does support a PIVOT command.
My similar problem was that the ORACLE ODBC connection hung after selecting the Link table/ODBC connection. Task manager said not responding after 10's of minutes. The connection then pings ORACLE for all available tables. I had turned on logging on the ORACLE ODBC Administrator, so it had to write all these things to the log, slowing any results by perhaps hours. The log was 60 MB one hour later, when I turned it off, then everything was fine!
To turn it off go to the Oracle installation/Network Administration/MS ODBC Adminstrator/Tracing tab and turn it OFF!
A good resource on ODBC is here: http://eis.bris.ac.uk/~ccmjs/odbc_section.html
Unfortunately Access is not able to push a lot of that work to the server, and yes, it will do huge table scans when designing queries against multiple tables or views in SQL Server.
You can build and tweak queries (views) in SQL Server using SSMS and store the views in SQL Server for a massive performance boost and still use Access for your front end.