rocha1001 Posted April 29, 2020 at 02:18 AM Report Share #617974 Posted April 29, 2020 at 02:18 AM Boa noite... Tenho varias tabelas na base de dados, mas uma tem dados encriptados queria ao carregar a DataGrid descodificar os dados dessa tabela para ver os dados corretos na coluna, como poderia fazer!? desde já obrigado... Link to comment Share on other sites More sharing options...
M6 Posted April 29, 2020 at 09:05 AM Report Share #617975 Posted April 29, 2020 at 09:05 AM Tens de te meter pelo meio e fazer o trabalho programaticamente. Ou seja, tens de fazer a query para obter os dadeos, depois tens de percorrer os resultados e enquanto o fazes, descodificas os valores e vais carregando-os para a DataGrid. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
rocha1001 Posted April 29, 2020 at 10:20 AM Author Report Share #617976 Posted April 29, 2020 at 10:20 AM Bom dia, isso eu sei, mas a minha dúvida é como faço a consulta... vou passar o código do carregamento da datagrid para compreender melhor. Public Sub LoadDataGrid() Try sql = "select * from tabUsuarios " & StatusAtivo conectar.Open() adaptador = New SqlDataAdapter(sql, conectar) local = New DataSet conectar.Close() adaptador.Fill(local, "tabUsuarios") resultado = local.Tables("tabUsuarios").Rows.Count If resultado > 0 Then Dim dt As DataTable = New DataTable adaptador.Fill(dt) DGridGrupoAcessos.DataSource = dt FormataDatagrid() 'CarregaImg() conectar.Close() ElseIf resultado = 0 Then 'MessageBox.Show("Não existe registos para ver...!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning) End If Catch ex As Exception MsgBox("Ups! ocoreu um erro: " & ex.Message & ".", MsgBoxStyle.Critical, "Lista de Acessos") Finally conectar.Close() End Try End Sub assim carrego a datagrid, agora como posso fazer o decript antes de carregar a datagrid... aqui é que tenho duvidas, obrigado. Link to comment Share on other sites More sharing options...
M6 Posted April 29, 2020 at 05:51 PM Report Share #617981 Posted April 29, 2020 at 05:51 PM Fazes a consulta com uma query, como que referi inicialmente. Tens de ver no manual como fazer isso. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
Solution rocha1001 Posted April 29, 2020 at 06:54 PM Author Solution Report Share #617982 Posted April 29, 2020 at 06:54 PM Boas, já resolvi, obrigado pela resposta e rapidez... foi mesmo o que fiz carrejei a datagrid manual e ates de a carregar fiz o que queria... While dr.Read() Dim stremail As String stremail = Descodifica(dr.Item("tbl_email"), My.Settings.ConfigLic) DGridGrupoAcessos.Rows.Add(dr.Item("id"), dr.Item("tbl_usuario"), dr.Item("tbl_nome"), dr.Item("tbl_apelido"), stremail, dr.Item("tbl_data"), dr.Item("tbl_ativo")) End While Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now