The dotted black line is called a relationship line, and it reveals that some kind of connection, either a parenting connection or a constraint connection, already exists between Sword1 and whatever this unnamed bone is. In either case, you will probably want to break this connection and start over. With the Sword1 bone selected, go to the Constraints tab in the Properties Panel, to the right of your 3D View, and check whether anything shows up. The relationship line is probably coming from something that will be found here. The other place you can check, but seems less likely, is the Object tab (not Object Data tab), and look under the Relations section, to see if the bone has a parent. If you found any connections, remove them. If you found none, then select the whole armature in Object Mode, and then tab into Edit Mode, then select the Sword1 bone, press Alt + p, and choose Clear Parent. Now your Sword1 bone should still be part of the armature, but shouldn't move with any part of it during posing. Go into Pose Mode, and move the Sword1 bone to the hand position. It might be a good idea to make sure the armature is in its rest pose before doing this, which can be activated in the Object Data tab, under the Skeleton section, where you'll see two buttons, Pose Position, and Rest Position. Choose Rest Position to see the rest pose. Once you've activated the Rest Position, however, you can't move any bones until you return to the Pose Position. So after activating the Rest Postion, press Ctrl + a and from the Apply menu, choose Apply Pose as Rest Pose. Now return to the Pose Position. You shouldn't have to do this again. It's a kind of calibration effort to ensure that you're working from the rest pose before adding constraints. If you add constraints without being in the rest pose first, weird things can happen.
Finally, while in Pose Mode, select Sword1 and create a Child Of constraint for it, and point this constraint to the hand IK target bone as the constraint's target. You will want to press the Clear Inverse button after creating the constraint to get the sword to remain where you placed it. It should follow the hand now when moving the IK target, and by keyframing the influence slider for the constraint, the sword can be released by the hand, or retrieved by it, any time you want.