problem
How to return user already exist on angular 7 ?
I work on web api working on asp.net core 2
I check users exist on database
if user i create exist on database then message will show to me
user already exist
- public static bool CheckUserName(string username)
- {
- bool status = false;
- // string constr = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
- using (SqlConnection conn = new SqlConnection(SQLDAL.ConnectionString))
- {
- using (SqlCommand cmd = new SqlCommand("CheckUserAvailability", conn))
- {
- cmd.CommandType = CommandType.StoredProcedure;
- cmd.Parameters.AddWithValue("@UserName", username.Trim());
- conn.Open();
- status = Convert.ToBoolean(cmd.ExecuteScalar());
- conn.Close();
- }
- }
- return status;
- }
and how to call it on Onsubmit event

Veerendra AnnigereRank #927 · 2.2K reputationPosted Jan 20, 2020, 11:31 AM EST
Ronika JencyRank #770 · 3K reputationPosted Jan 20, 2020, 6:56 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Jan 20, 2020, 7:40 AM EST
Veerendra AnnigereRank #927 · 2.2K reputationPosted Jan 20, 2020, 10:09 AM EST