Friday, April 18, 2008

A simple code for Check Availability

protected void btncheckavail_Click(object sender, EventArgs e)
{
scn.Open();
SqlCommand cmd = new SqlCommand("select userid from Registration where userid='" + txtuserid.Text + "'", scn);
string str = Convert.ToString(cmd.ExecuteScalar());
if (str =="")
{
lbl.Text = UserID is Available
}
else
{
lbl.Text = "This UserID is Already Exists";
lbl.Visible = true;

}
}

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...