public static int GetUserIdFromUserName(string username)
{
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
return
(from u in data.UserDataProviders
where u.user_name == username
select u.id).FirstOrDefault();
}
}