Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change SQL read data on the fly... 1

Status
Not open for further replies.

LittlBUGer

Programmer
Apr 26, 2006
81
US
Hello, this may sound like a dumb question, but I can't figure it out. I have an ASP.NET site with a datagrid. Usually I read some data from a SQL database and bind it directly to the datagrid, something like:

Code:
cmdSelect = New SqlCommand( "Blah Blah...", sqlconn )
MyDG.DataSource = cmdSelect.ExecuteReader()		
MyDG.DataBind()

Now I have a different situation. I have data in the database that's encrypted so when I read it, I need to decrypt it on the fly and then bind it to the datagrid. I was thinking of maybe using a dataset, but I'm very unfamiliar with them. Is there an easier way? I already know how to do all of the decryption stuff and whatnot, it's just going from the data from the database to the datagrid, but first modifying it, which is the problem. Thanks.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
 
Try using the ItemDataBound event of the DataGrid. You can access the cells directly and perform your decryption routines.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Duh! Damnit... I must have had a brain-fart there... I will see how that goes. Thanks.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top