SQLDataSource Trusted Connection blocked

I'm attempting to migrate existing user controls to SharePoint 2007 web parts.

So far, things are working out well except for the SQLDataSource. Apparently, SP 2007 replaces the standard SQLDataSource UI control at runtime with an SPSqlDataSource . This control doesn't allow Trusted Connection / Integrated Security attribs in connection string.

Everything works fine when I switch to SQL authentication on the database (and store UID, PWD in connection string).

It also works well if I create a class that inherits from SQLDataSource and then use that tag in the web part. I have some concerns about using this particular method, however.

Is there a recommended method for having SqlDataSource in an SP 2007 Web Part (or are we not supposed to do that)?

Thanks.

[889 byte] By [jgotthard] at [2008-3-7]
# 1

try setting the AllowIntegratedSecurity property to true

<SharePointWebControls:SPSqlDataSource .... AllowIntegratedSecurity="True" ConnectionString="Data Source=...;Initial Catalog=...;Integrated Security = SSPI;" ProviderName="System.Data.SqlClient"/>

SPAN at 2007-9-4 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...

SharePoint Products and Technologies

Site Classified