Reputation: 171
So I can't seem to iterate through this dataset. I've created the datasource, added fields to the table, added the table to the source and updated the database. But I do not get the login method I'm looking for. I only get LoginRow and LoginDataTable which do not allow me to iterate through my database to check for unique usernames. Any guidance would be appreciated, haven't had to use databases in a while.
private void AddUser(string username, string password, string first_name, string last_name, string email)
{
Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
Match match = regex.Match(email);
foreach(DataRow row in LoginDataSet.LoginRow)
{
}
}
Upvotes: 0
Views: 55
Reputation:
You need to get your rows collection from the table:
foreach(DataRow row in LoginDataTable.Rows)
Upvotes: 1