vb.net - Entity Framework connecting to wrong database -
i have existing database , i'm trying connect using entity framework, throws exception saying
the server principal "user" not able access database "databasetwo" under current security context.
however, i'm not trying connect databasetwo, there no reference anywhere in entire solution.
my dbcontext: (databaseone)
public class mycontext inherits dbcontext public sub new() mybase.new("databaseone") end sub public property objects dbset(of object) end class
web.config connection string:
<add name="databaseone" connectionstring="server=myserver.com;database=databaseone;uid=myuser;pwd=mypwd; app=myapp;" providername="system.data.sqlclient"/>
the other database exist on server , user have access both database 1 , two, strange consdering says dosen't have permission
the entity had different name table, using attribute specify exact table name seemed fix problem. still exception strange
<table("correcttablename")> public class mytable <key> public property id integer end class
Comments
Post a Comment