Reputation: 37
How do I check if a textbox contains "@mediacollege.dk" in like this
if (email.text == "here it checks if it contains "@mediacollege.dk" and does a command")
{
DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
DHFLodder.Insert(UserName.Text, 10);
}
else
{
// nothing
}
Upvotes: 0
Views: 2505
Reputation: 6123
You can do it as
if (email.text.Contains("@mediacollege.dk") )
{
// do your work
DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
DHFLodder.Insert(UserName.Text, 10);
}
else
{
// nothing
}
Upvotes: 1