به عزیز،
من با Entity Framework Code First می خوام یک جدول درست کنم ولی با این Error روبرو میشم:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
using System
using System.Collections.Generic
using System.ComponentModel
using System.Data
using System.Drawing
using System.Linq
//using System.Data.Entity
using System.Text
using System.Threading.Tasks
using System.Windows.Forms
namespace Ef_3_09
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent()
}
private void btnAddSomeNewCountries_Click(object sender, EventArgs e)
{
Models.DatabaseContext ODataBaseContext = new Models.DatabaseContext()
Models.Country Cun = new Models.Country()
try
{
Cun.Name = iran
ODataBaseContext.Countries.Add(Cun)
ODataBaseContext.SaveChanges()
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message)
}
finally { }
}
}
}
-
<?xml version=1.0 encoding=utf-8?>
<!- For more information on Entity Framework configuration, visit
http://go.microsoft.com/fwlink/?LinkID=237468 ->