Home > Net >  This is where the problem? Very tight?
This is where the problem? Very tight?

Time:04-13

Public class Factry
{
Public string Miner_address {get; set; }
Public string PledgeFactory {get; set; }

}


[HttpGet]
Public ActionResult GetFactory (string userid, string pass)
{


The DataTable dt.
Factry Umm=new Factry ();

If (checkname (userid, pass))
{

If (connopen ())
{



String ls_string="select pool_address_gf, PledgeFactory from configtb";



Try

{

Dt=DataSet_out_ (ls_string);

}
Catch


{

Umm. Miner_address=null;
Umm. PledgeFactory=null;
Return Umm.



}







if (! The Convert. IsDBNull (dt))

{


If (dt) Rows) Count!=0)
{
If (dt) Rows [0] [0]==null)
{

Umm. Miner_address=null;

}
The else
{
If (dt) Rows [0] [0]. The ToString ()=="")
{
Umm. Miner_address=null;

}
The else
{
Umm. Miner_address=dt. Rows [0] [0]. The ToString ();

}





}

If (dt) Rows [0] [1]==null)
{
Umm. PledgeFactory=null;

}
The else
{
If (dt) Rows [0] [1]. The ToString ()=="")
{
Umm. PledgeFactory=null;

}
The else
{
Umm. PledgeFactory=dt. Rows [0] [1]. The ToString ();

}


}


}
The else
{


Umm. Miner_address=null;
Umm. PledgeFactory=null;

}



}
The else
{

Umm. Miner_address=null;
Umm. PledgeFactory=null;

}


}
The else
{



Umm. Miner_address=null;
Umm. PledgeFactory=null;


}



}
The else
{

Umm. Miner_address=null;
Umm. PledgeFactory=null;

}


Return Umm.


}


Today the console returning an error is as follows:
Fail: Microsoft AspNetCore. Diagnostics. DeveloperExceptionPageMiddleware [1]
An unhandled exception has occurred while executing the request.
System. NullReferenceException: Object reference not set to an instance of an Object.
The at smartx. Controllers. ValuesController. GetFactory (String userid, String pass)
At lambda_method (Closure, the Object, the Object [])
At Microsoft. AspNetCore. Mvc. Proceeds. ActionMethodExecutor. SyncObjectResultExecutor. Execute (IActionResultTypeMapper mapper, ObjectMethodExecutor executor, the Object controller, Object [] the arguments)
At Microsoft. AspNetCore. Mvc. Proceeds. ControllerActionInvoker. InvokeActionMethodAsync ()
At Microsoft. AspNetCore. Mvc. Proceeds. ControllerActionInvoker. Next (State& Next, Scope& The scope, Object& The state, Boolean& IsCompleted)
At Microsoft. AspNetCore. Mvc. Proceeds. ControllerActionInvoker. InvokeNextActionFilterAsync ()
- the End of the stack trace from previous location where the exception was thrown -- -- --
At Microsoft. AspNetCore. Mvc. Proceeds. ControllerActionInvoker. Rethrow (ActionExecutedContextSealed context)
At Microsoft. AspNetCore. Mvc. Proceeds. ControllerActionInvoker. Next (State& Next, Scope& The scope, Object& The state, Boolean& IsCompleted)
At Microsoft. AspNetCore. Mvc. Proceeds. ControllerActionInvoker. InvokeInnerFilterAsync ()
- the End of the stack trace from previous location where the exception was thrown -- -- --
At Microsoft. AspNetCore. Mvc. Proceeds. ResourceInvoker. & lt; InvokeFilterPipelineAsync> 19 _0 g__Awaited | (ResourceInvoker invoker, Task lastTask, State next, and the Scope the Scope, Object State, Boolean isCompleted)
At Microsoft. AspNetCore. Mvc. Proceeds. ResourceInvoker. & lt; InvokeAsync> G__Awaited | 17 _0 (ResourceInvoker invoker, Task Task, IDisposable scope)
At Microsoft. AspNetCore. Routing. EndpointMiddleware. & lt; Invoke> G__AwaitRequestTask | 6 _0 (Endpoint Endpoint, Task requestTask, ILogger logger)
At Microsoft. AspNetCore. Authorization. AuthorizationMiddleware. Invoke (HttpContext context)
At Microsoft. AspNetCore. Diagnostics. DeveloperExceptionPageMiddleware. Invoke (HttpContext context)


  •  Tags:  
  • C#
  • Related