cmd.Parameter("ORDER_NUM_FROM").Value = If(txtOrderNumFrom.TextLength = 0, Integer.MinValue, CInt(txtOrderNumFrom.Text)) cmd.Parameter("ORDER_NUM_TO" ).Value = If(txtOrderNumTo.TextLength = 0, Integer.MinValue, CInt(txtOrderNumTo.Text ))
If txtOrderNumFrom.TextLength = 0 Then cmd.Parameter("USE_ORDER_NUM_FROM").Value = 0 cmd.Parameter( "ORDER_NUM_FROM").Value = DBNull.Value Else cmd.Parameter("USE_ORDER_NUM_FROM").Value = 1 cmd.Parameter( "ORDER_NUM_FROM").Value = CInt(txtOrderNumFrom.Text) End If If txtOrderNumTo.TextLength = 0 Then cmd.Parameter("USE_ORDER_NUM_TO").Value = 0 cmd.Parameter( "ORDER_NUM_TO").Value = DBNull.Value Else cmd.Parameter("USE_ORDER_NUM_TO").Value = 1 cmd.Parameter( "ORDER_NUM_TO").Value = CInt(txtOrderNumTO.Text) End If