c# - Passing SQL Server exception to .net for ExecuteSprocAccessor to consume -


g'day everybody. need finalize answer similar question. unfortunately, since not have enough points, can not ask final solution people involved. original question here: "[passing sql server exception .net][1]"

so, problem: try/catch statement in sql server 2012 swallows exception want pass or re-throw ef 5.0. long exception without try/catch, .net code gets without problems.

attempts solve: 1. sql server side: have tried throw / raiseerror, raising exception in , outside of try/catch block, recording original error , re-throwing again. 2. .net side tried planned overloaded "executesprocaccessor" , changed basic code "... sqldataadapter dataadap = new sqldataadapter(command); dataadap.fill(dt); " nothing worked 3. option - guess - think parameter in sql server might blocking - not know yet

solution: looking , advise how original managed supressed try/catch behavior. thanks!

we have spent day in further attempt bottom of and, accidentally, found temporary solution. since there no initial response, posting solution. though, it's more temporary solution. usage of "db.executedataset(dbc)" worked fine providing relevant handling of exceptions passed sql server 2012 catch block. shows there tricks or problems not know yet el6.0 and/or ado.net in new version

    *using ( dbcommand dbc = db.getstoredproccommand("[personnel].[uspweblogin]"))              {                  db.addinparameter(dbc, "userlogin", dbtype.string, user.userlogin);                  db.addinparameter(dbc, "userpassword", dbtype.string, user.password);                  dataset ds = db.executedataset(dbc);                  datatablereader dtr =  ds.createdatareader();                    				// string count check theat core query actualy worked when there no exception  				string count = dtr.fieldcount.tostring();  				......                  return new webuser();              }*

the problems on how optimize best mapping of objects , return set instead of writing heaps of code "executesprocaccessor" , "irowmapper" doing us.

thanks reading. further comments or suggestions still welcomed. cheers.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -