datagridview中的加密数据 [英] Encrypted data in datagridview
问题描述
大家好..我对datagridview很新,我想知道有没有办法在访问中转换加密数据并在datagridview中显示它?我正在使用C#和微软访问
通常这是如何在datagridview中显示数据:
OleDbConnection conn = new OleDbConnection(" Provider = Microsoft.Jet.OLEDB.4.0; Data Source ="");
OleDbCommand command = conn.CreateCommand();
string strSQL =" SELECT * FROM雇员英寸;
ds = new DataSet();
conn.Open();
command.CommandText = strSQL;
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
adapter.Fill(ds);
dataGridView1.DataSource = ds.Tables [0];
dataGridView1.ReadOnly = true;
conn.Close();
我应该在数据网格中显示之前更改为解密这些数据? div class =h2_lin>解决方案
你知道如何取消加密吗?如果是这样,只需对数据集中的数据kep运行解密?
你知道如何解密它吗?如果是这样,只需对数据集中的数据kep运行解密?
是..我知道如何解密它。但我正在做的是一次解密1
例如。 temp =(string)read [" Username"];
encryption.decrypt(temp,true);
这只解密用户名..问题是我不知道如何在datagrid中显示它。所有这一切,我只在一个while循环使用这个方法。
例如。
while(read.read())
{
//解密
}
好吧,填充你的DataSet,然后遍历数据集。
hi guys..im new to datagridview and im wondering is there a way to convert an encrypted data in access and show it in a datagridview? im using C# and microsoft access
normally this is how to show data in datagridview:
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source="");
OleDbCommand command = conn.CreateCommand();
string strSQL = "SELECT * FROM Employee";
ds = new DataSet();
conn.Open();
command.CommandText = strSQL;
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
adapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
dataGridView1.ReadOnly = true;
conn.Close();
where should i change to decrypt those data before showing it in the datagrid?
Do you know how to un-encrypt it? If so, just run the decrypting on the data kep in the dataset?
Do you know how to un-encrypt it? If so, just run the decrypting on the data kep in the dataset?yes..i know how to decrypt it. but what im doing is to decrypt it 1 at a time
eg. temp=(string)read["Username"];
encryption.decrypt(temp, true);
this decrypts the username only..the problem is i dont know how to show this in the datagrid. all this while i used this method only in a while loop.
eg.
while(read.read())
{
//decrypt
}
Well, populate your DataSet, then loop through the dataset.
这篇关于datagridview中的加密数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!