Migrate from SQL server 2008 to 2012 - sql-server

I have successfully migrated all my databases from 2008 to 2012 and mapped the user to the specific databases.
My problem being is 2008 expired (hence why I got 2012) and I was using a web service to call/edit data in the tables.
When I run a web service function it just times out which suggests to me that it is still trying to talk to 2008.
I am using -
using System.Data.OleDb;
using System.Data.SqlClient;
with connection -
OleDbConnection objConnection = null;
OleDbCommand objCmd = null;
String strConnection, strSQL;
strConnection = "Provider=sqloledb;Data Source=.;Initial Catalog=NSN;User Id=userID;Password=password;Connect Timeout=300";
My question being, how can I tell the web service to point at SQL server 2012 now that I have migrated all the databases?

If your SQL Server 2008 has expired why dont you then remove the access for the user mentioned in your connection string to the SQL 2008 Db or best make it offline. If the application fails then you know that it was still pointing to SQL2008.

Try to change your connection string to the following:
strConnection = "Provider=sqloledb;Data Source=.\<INSTANCENAME>;Initial Catalog=NSN;User Id=userID;Password=password;Connect Timeout=300";
Where is the name of your SQL Server 2012 instance. It should be the same as you type in the 'Server name' in management studio login dialog.
The problem is that you are trying to connect to the default instance which is your SQL Server 2008 installation.

Related

Upgrading SQL Management from Express 2012 to Enterprise 2016

I am migrating my Webappserver from SQL2012Express to SQL2016Enterprise.
for this I have installed a Windows server 2016 with IIS10 my current IIS db connection String is
"data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
this is on Windows 2008 and IIS 7 with SQL 2012 Express.
Now on the new webappserver my source is no longer SQLexpress since the SQL is enterprise not express. my instance name was SQL2012 I changed it to Sql2016 in my Software's web.config and IIS as well I am not able to connect my software to the Database.
Here is what my current Db String is on the current webappserver.
My SQL management Studio is
On the New Server My ISS db connection string is the same which is express?
and my SQL Studio properties are
My connection string in my MVC app web.config file is
I hope I am giving you enough information to help me on this challenge I am facing.
This is my first time migrating SQL server and I am sure I have create the instance correctly.
my connection String to the site on IIS is
data source=.\SQL2016;Integrated Security=True;App=Worldwide;Initial Catalog=Worldwide
Any Help is very, very appreciate it.
Thank you.

Connecting Crystal Reports 2008 to SQL Server 2014

I am trying to connect Crystal Reports to SQL Server 2014. I have integrated security on my db which works great.
When I fire up Crystal Reports I choose from a new connection drop down OLE DB (ADO) and then Microsoft OLE DB provider for SQL Server.
After that at the connection Information I insert localhost and choose Integrated Security.
The problem is that I cannot see my database in the databases drop down list after this.
Any thoughts?
Is the localhost as a server name correct? Why can't I see my databases?
See if you can successfully connect to SQL Server through SSMS using Localhost and windows Authentication using same login you are using for Crystal.
Once you are sure about it then we can look into drivers or other possible issues.

Which version of SQL Server supports.Net framework 4.5?

I am new to .NET technology and I am using Visual Studio 2012 and .net framework 4.5. I tried SQL Server 2008 but I'm unable to connect to it with server name . and .\SQLEXPRESS.
Which version of SQL Server should I install for database access and please provide the link for same?
VS.NET 2012 ships with SQL Server 2012 Express LocalDb. If you use LocalDb and its file is located in App_Data\DatabaseFileName.mdf then you could connect using
<add name="ConnectionStringName"
providerName="System.Data.SqlClient"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFileName=|DataDirectory|\DatabaseFileName.mdf;InitialCatalog=DatabaseName;Integrated Security=True" />
To see what database is in use you can either from VS.NET or using SQL Server Management Studio
If you use other database, e.g. SQL Server 2008, you need to make sure that
name of the server and the SQL Server instance
server is up and running
You can use ".", "(local)", or "localhost" in place of the server name to specify the local computer, but you need to make sure that server is there.
Open SQL Server Management Studio, Connect to Server and see the name of the server and its authentication type. If it is a Windows Authentication you can use Integrated Security=True in the connection string.
Example:
using System.Data.SqlClient;
protected void Page_Load(object sender, EventArgs e)
{
string connectionString = #"Data Source=\SQLEXPRESS;Initial Catalog=DBNAME_HERE;Integrated Security=True";
using (SqlConnection objSqlConnection = new SqlConnection(connectionString))
{
try {
objSqlConnection.Open();
objSqlConnection.Close();
Response.Write("Connection is successfull");
} catch (Exception ex) {
Response.Write("Error : " + ex.Message.ToString());
}
}
}
Reed more here.
Microsoft SQL Server 2012 Express have the following limitations:
Maximum database size 10GB
Maximum usage of Ram 1GB
Single physical CPU
No SQL Server Agent (job scheduler)
Profiler tool is not included
Also, your connection string should be something like this:
Server=.\SQLExpress;AttachDbFilename=C:\MyFolder\MyDataFile.mdf;Database=dbname;
Trusted_Connection=Yes;

Can I use Microsoft WebMatrix to access SQL Server 2008?

I created a development web database following these instructions: http://www.w3schools.com/website/webpages_database.asp
var db = Database.Open("Northwind");
var query = db.Query("SELECT CompanyName,City,Country FROM Customers");
The example code provided uses Microsoft WebMatrix to access the database. At a later time, however, I would need to access the a SQL Server 2008 production database by a connection string.
Can Microsoft WebMatrix be used for that purpose?
Here are the instructions on how to do it using SSMS for Sql Server 2008 R2
http://msdn.microsoft.com/en-us/library/ms190209(v=sql.105).aspx

vb.net connect to sql server 2008 - login failed for user' '

I'm currently upgrading my sql server from 2005 to 2008 enterprise server. I used VB to connect to the database. It worked fine in the previous version of sql, but when upgrading it seems doesn't recognize my connection string.
Below is my connection string:
myConnection = New SqlConnection("server=RAVY-PC\RAVY;uid=;pwd=;database=CIEDC");
myConnection.Open();
Where Ravy-PC\RAVY is my server name at the sql server login dialogue box. And I used the windows authentication mode.
Any help would be appreciated. Thanks guy for viewing....
Try this connection string:
Server=RAVY-PC\RAVY;Database=CIEDC;Trusted_Connection=True;

Resources