if your Login ID is a a textbox then in the OnClick event of the button:
string MyCheckQuery = string.Format("SELECT count(0) FROM tblLogin WHERE loginName ='{0}'", textBox1.Text);
That query can be used with an SqlCommand
http://msdn.microsoft.com/en-us/library/877h0y3a.aspx[
^]
If the result of the query = 0 then the name is unique, otherwies the result of the query is 1