views:

7

answers:

0

Hi all

I have a old question about permisson. I know I can use the SPSecurity to run unser a special account, but in this case, the situation is something different. Here is the situation:

I make a web part with a GridView and a SqlDatasource on it. This GridView would display some data from a SQL Server. Users have no permission to access this databse, so I use the SPSecurity to access the database. When the page loads, I explict call the Databind() in SPSecurity, everything is fine, users can see the data. Now I want to sort the data, so I make the AllSorting=True, and set the SortExpression for some columns. When I click the column header, it throw an exception. The permission problem. I can not explict call the Databind() now. Does anyonw has the problem before?

Best Regards,