string csdl = @"res://*/MainDBModel.csdl";
string ssdl = @"res://*/MainDBModel.ssdl";
string msl = @"res://*/MainDBModel.msl";
var edmItemCollection = new EdmItemCollection(csdl);
var storeItemCollection = new StoreItemCollection(ssdl);
var storeMappingItemCollection = new StorageMappingItemCollection(
edmItemCollection,
storeItemCollection,
msl
);
_metadataWorkspace.RegisterItemCollection(edmItemCollection);
_metadataWorkspace.RegisterItemCollection(storeItemCollection);
_metadataWorkspace.RegisterItemCollection(storeMappingItemCollection);
SqlConnectionStringBuilder scb = new SqlConnectionStringBuilder();
scb.DataSource = "192.168.0.1"+ @"\" + "dbName;"
scb.UserID = "wx";
scb.Password = "123456";
scb.InitialCatalog = "wx";
_sqlConnection.ConnectionString = scb.ConnectionString;