Jump to content

[Resolvido] Erro: Value of type "string" cannot be converted to "GUID"


DarkAngelRev

Recommended Posts

Boa tarde, no código que deixo em seguida dá me o erro descrito no titulo, mas como podem ver já tentei fazer um cast e mesmo assim continua a dar erro alguém que já tenha tido situação semelhante me pode dar uma ajuda se faz favor.

Dim servico As New WebServiceLoja.WebService
 Dim resultado As Boolean
 For Each row As GridViewRow In gvPrimavera.Rows
	 Dim cb As CheckBox = row.FindControl("checkSelection")
	 If cb.Checked = True Then
		 Dim id As Guid = CType(row.Cells(1).Text, Guid)
		 resultado = SincronizarEncomendas(id)
	 End If
 Next
 For Each row As GridViewRow In gvCliente.Rows
	 Dim cb As CheckBox = row.FindControl("checkSelection2")
	 If cb.Checked = True Then
		 Dim id As Guid = row.Cells(1).Text
		 resultado = SincronizarEncomendas(id)
	 End If
 Next
 If resultado = True Then
	 MsgBox("Sincronização Completa!", MsgBoxStyle.Information, "Sucesso")
	 UncheckAll(gvPrimavera, "checkSelection", "checkAll")
	 UncheckAll(gvCliente, "checkSelection2", "checkAll2")
 Else
	 MsgBox("Sincronização não efectuada!", MsgBoxStyle.Critical, "Erro")
 End If
Edited by Caça
GeSHi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.