c# - Error: The request could not be completed (Internal Server Error) on Azure Mobile Services -


i building windows 8.1 metro app connects server backend hosted on azure. right now, testing, when tap button on app screen, triggers function insert value database.

the code here:

private async void submitclick(object sender, routedeventargs e)     {       companies quiblify = new companies {name = "companyx"};       await app.mobileservice.gettable<companies>().insertasync(quiblify);     } } 

when run app , tap button, error:

an exception of type 'microsoft.windowsazure.mobileservices.mobileserviceinvalidoperationexception'  occurred in mscorlib.dll not handled in user code  additional information: request not completed.  (internal server error) 

what problem?

edit: here server side code.

// post tables/companies public async task<ihttpactionresult> postcompany(companies item) {     companies current = await insertasync(item);      return createdatroute("tables", new { id = current.id }, current); } 

here error log:

exception=system.data.sqlclient.sqlexception (0x80131904): cannot open database "master" requested login. login failed. login failed user 'dndckodbwdlogin_modernposbackend'. session has been assigned tracing id of 'bafdb889-b1b9-42a1-ace5-101ed382c1d2'.  provide tracing id customer support when need assistance.    @ system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, uint32 waitformultipleobjectstimeout, boolean allowcreate, boolean onlyonecheckconnection, dbconnectionoptions useroptions, dbconnectioninternal& connection)    @ system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, taskcompletionsource`1 retry, dbconnectionoptions useroptions, dbconnectioninternal& connection)    @ system.data.providerbase.dbconnectionfactory.trygetconnection(dbconnection owningconnection, taskcompletionsource`1 retry, dbconnectionoptions useroptions, dbconnectioninternal oldconnection, dbconnectioninternal& connection)    @ system.data.providerbase.dbconnectioninternal.tryopenconnectioninternal(dbconnection outerconnection, dbconnectionfactory connectionfactory, taskcompletionsource`1 retry, dbconnectionoptions useroptions)    @ system.data.providerbase.dbconnectionclosed.tryopenconnection(dbconnection outerconnection, dbconnectionfactory connectionfactory, taskcompletionsource`1 retry, dbconnectionoptions useroptions)    @ system.data.sqlclient.sqlconnection.tryopeninner(taskcompletionsource`1 retry)    @ system.data.sqlclient.sqlconnection.tryopen(taskcompletionsource`1 retry)    @ system.data.sqlclient.sqlconnection.open()    @ system.data.entity.infrastructure.interception.dbconnectiondispatcher.<open>b__36(dbconnection t, dbconnectioninterceptioncontext c)    @ system.data.entity.infrastructure.interception.internaldispatcher`1.dispatch[ttarget,tinterceptioncontext](ttarget target, action`2 operation, tinterceptioncontext interceptioncontext, action`3 executing, action`3 executed)    @ system.data.entity.infrastructure.interception.dbconnectiondispatcher.open(dbconnection connection, dbinterceptioncontext interceptioncontext)    @ system.data.entity.sqlserver.sqlproviderservices.<>c__displayclass34.<usingconnection>b__32()    @ system.data.entity.sqlserver.defaultsqlexecutionstrategy.<>c__displayclass1.<execute>b__0()    @ system.data.entity.sqlserver.defaultsqlexecutionstrategy.execute[tresult](func`1 operation)    @ system.data.entity.sqlserver.defaultsqlexecutionstrategy.execute(action operation)    @ system.data.entity.sqlserver.sqlproviderservices.usingconnection(dbconnection sqlconnection, action`1 act)    @ system.data.entity.sqlserver.sqlproviderservices.usingmasterconnection(dbconnection sqlconnection, action`1 act)    @ system.data.entity.sqlserver.sqlproviderservices.createdatabasefromscript(nullable`1 commandtimeout, dbconnection sqlconnection, string createdatabasescript)    @ system.data.entity.sqlserver.sqlproviderservices.dbcreatedatabase(dbconnection connection, nullable`1 commandtimeout, storeitemcollection storeitemcollection)    @ system.data.entity.core.common.dbproviderservices.createdatabase(dbconnection connection, nullable`1 commandtimeout, storeitemcollection storeitemcollection)    @ system.data.entity.core.objects.objectcontext.createdatabase()    @ system.data.entity.migrations.utilities.databasecreator.create(dbconnection connection)    @ system.data.entity.migrations.dbmigrator.ensuredatabaseexists(action mustsucceedtokeepdatabase)    @ system.data.entity.migrations.dbmigrator.update(string targetmigration)    @ system.data.entity.internal.databasecreator.createdatabase(internalcontext internalcontext, func`3 createmigrator, objectcontext objectcontext)    @ system.data.entity.internal.internalcontext.createdatabase(objectcontext objectcontext, databaseexistencestate existencestate)    @ system.data.entity.database.create(databaseexistencestate existencestate)    @ system.data.entity.dropcreatedatabaseifmodelchanges`1.initializedatabase(tcontext context)    @ system.data.entity.internal.internalcontext.<>c__displayclassf`1.<createinitializationaction>b__e()    @ system.data.entity.internal.internalcontext.performinitializationaction(action action)    @ system.data.entity.internal.internalcontext.performdatabaseinitialization()    @ system.data.entity.internal.lazyinternalcontext.<initializedatabase>b__4(internalcontext c)    @ system.data.entity.internal.retryaction`1.performaction(tinput input)    @ system.data.entity.internal.lazyinternalcontext.initializedatabaseaction(action`1 action)    @ system.data.entity.internal.lazyinternalcontext.initializedatabase()    @ system.data.entity.internal.internalcontext.getentitysetandbasetypefortype(type entitytype)    @ system.data.entity.internal.linq.internalset`1.initialize()    @ system.data.entity.internal.linq.internalset`1.get_internalcontext()    @ system.data.entity.internal.linq.internalset`1.actonset(action action, entitystate newstate, object entity, string methodname)    @ system.data.entity.internal.linq.internalset`1.add(object entity)    @ system.data.entity.dbset`1.add(tentity entity)    @ microsoft.windowsazure.mobile.service.entitydomainmanager`1.<insertasync>d__0.movenext() --- end of stack trace previous location exception thrown ---    @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task)    @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task)    @ microsoft.windowsazure.mobile.service.tablecontroller`1.<insertasync>d__3.movenext() clientconnectionid:8edddc79-b06c-4c06-8cd2-aedc688e2c99 error number:4060,state:1,class:11, id=d3a27e91-15b5-4cd3-a8a5-761434cc363b, category='app.controllers.tables' 

you're connecting master schema database, connection string user doesn't have permissions. should edit ms_tableconnectionstring in portal, or create new connection string , use one. should make sure using right database schema.

here's guide more information: http://hashtagfail.com/post/84964727000/mobile-services-net-backend-connection-strings

see also:


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -