I did a method which add a user in storage. Below is the code and the error that I'm getting.
public string addusr(string nome, string cidade, string cpf, string email, string telefone)
{
try
{
if (nome.Length == 0)
return "f:Preencha o campo nome.";
if (cidade.Length == 0)
return "f:Preencha o campo cidade.";
if (cpf.Length == 0)
return "f:Preencha o campo cpf.";
if (!Valida(cpf))
return "f:CPF Invalido.";
if (email.Length == 0)
return "f:Preencha o campo email.";
Regex rg = new Regex(@"^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$");
if (!rg.IsMatch(email))
{
return "f:Email Invalido";
}
List<UserEntity> lst = new List<UserEntity>();
var _account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("Conn"));
var _context = new CRUDUserEntities(_account.TableEndpoint.ToString(), _account.Credentials);
if (_context.Select(cpf).Count() > 0)
return "dup";
var account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("Conn"));
var context = new CRUDUserEntities(account.TableEndpoint.ToString(), account.Credentials);
UserClientEntity entity = new UserClientEntity() { nome = nome, cidade = cidade, cpf = cpf, email = email, telefone = telefone };
context.ADDUSociate(entity);
return "k";
}
catch (Exception exc)
{
string error = "f:" + exc.Message + "|" + exc.StackTrace;
// Trace.WriteLine("Erro no login: " + error , "Information");
return error;
}
}
When I try to add a user...I'm getting this error: f:An error occurred while processing this request.| at Microsoft.WindowsAzure.StorageClient.Tasks.Task
1.get_Result() at Microsoft.WindowsAzure.StorageClient.Tasks.Task
1.ExecuteAndWait() at Microsoft.WindowsAzure.StorageClient.CommonUtils. d__0
1.MoveNext() at System.Linq.Enumerable.Count[TSource](IEnumerable
illDev
0 Points
3 Posts
Problem when try to save in Windows Azure Table
Jan 04, 2013 12:27 PM|LINK
I did a method which add a user in storage. Below is the code and the error that I'm getting.
public string addusr(string nome, string cidade, string cpf, string email, string telefone) { try { if (nome.Length == 0) return "f:Preencha o campo nome."; if (cidade.Length == 0) return "f:Preencha o campo cidade."; if (cpf.Length == 0) return "f:Preencha o campo cpf."; if (!Valida(cpf)) return "f:CPF Invalido."; if (email.Length == 0) return "f:Preencha o campo email."; Regex rg = new Regex(@"^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$"); if (!rg.IsMatch(email)) { return "f:Email Invalido"; } List<UserEntity> lst = new List<UserEntity>(); var _account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("Conn")); var _context = new CRUDUserEntities(_account.TableEndpoint.ToString(), _account.Credentials); if (_context.Select(cpf).Count() > 0) return "dup"; var account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("Conn")); var context = new CRUDUserEntities(account.TableEndpoint.ToString(), account.Credentials); UserClientEntity entity = new UserClientEntity() { nome = nome, cidade = cidade, cpf = cpf, email = email, telefone = telefone }; context.ADDUSociate(entity); return "k"; } catch (Exception exc) { string error = "f:" + exc.Message + "|" + exc.StackTrace; // Trace.WriteLine("Erro no login: " + error , "Information"); return error; } }When I try to add a user...I'm getting this error: f:An error occurred while processing this request.| at Microsoft.WindowsAzure.StorageClient.Tasks.Task
1.ExecuteAndWait() at Microsoft.WindowsAzure.StorageClient.CommonUtils. d__0
1 source) at mobile.Service1.addusr(String nome, String cidade, String cpf, String email, String telefone)
I don't know what is wrong..
XIII
All-Star
182787 Points
23484 Posts
ASPInsiders
Moderator
MVP
Re: Problem when try to save in Windows Azure Table
Jan 04, 2013 01:20 PM|LINK
Hi,
which version of theAPI are you using? 2.0 or a former version?
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
illDev
0 Points
3 Posts
Re: Problem when try to save in Windows Azure Table
Jan 04, 2013 01:49 PM|LINK
Azure storage 2.0 and AzureStorageClient 1.7