How to create programmatically conncetion string without entity metadata in code first approch -


i trying create connection string programmatically got error need configure metatdata nama & when using code first approach don't have @adventureworksmodel.ssdl|///adventureworksmodel.csdl res:///adventurdventureworksmodel.msl"; how able configure connection string

some code on trying

        sqlconnectionstringbuilder sqlconnectionbuilder = new sqlconnectionstringbuilder();         sqlconnectionbuilder.datasource = @"10.103.201.31";         sqlconnectionbuilder.initialcatalog = database;         sqlconnectionbuilder.integratedsecurity = true;         sqlconnectionbuilder.multipleactiveresultsets = true;         string sqlconnectionstring = sqlconnectionbuilder.connectionstring;          //initialize entityconnectionstringbuilder         entityconnectionstringbuilder entitybuilder = new entityconnectionstringbuilder();         entitybuilder.provider = "system.data.sqlclient";         entitybuilder.providerconnectionstring = sqlconnectionstring;          //set metadata location.         entitybuilder.metadata = @"res://*/";          //create entity connection         entityconnection connection = new entityconnection(entitybuilder.connectionstring);          return new sqlcodefirstcontext(connection); 


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -