try this
Make Stored Procudureof below code:
create procedure check_contact_No
@parameter_entered_contact_num as varchar(50)
as
begin
if(not Exists(select ad_contact_1 from admin_user_profile where ad_contact_1 = @parameter_entered_contact_num ))
if( Exists(select ad_contact_1 from admin_user_profile where ad_contact_1 = @parameter_entered_contact_num ))
select COUNT(*) from admin_user_profile
else
select COUNT(*) from admin_user_profile where ad_contact_1 = @parameter_entered_contact_num
end
and check this in vb.net code
Dim objcls As New database_Connection
Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim cmd As New OleDbCommand
Dim con As New OleDbConnection
Dim flag As Boolean
Try
con = objcls.GetConnection()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "check_contact_No"
cmd.Parameters.Add(New OleDbParameter("@parameter_entered_contact_num", txt_contactno.Text))
cmd.Connection = con
da.SelectCommand = cmd
da.Fill(ds)
If (ds.Tables(0).Rows.Count = 0) Then
Else
End If
Return flag
Catch ex As Exception
End Try