.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Post New Web Links

How set connection Integrated Security property

Posted By:      Posted Date: October 30, 2010    Points: 0   Category :Sql Server

Does anyone have a handy snippet of code in C# or VB.net to find and set the "Integrated Security" property of a connection?

I used to do this stuff in DTS, but ... that was a long time ago!




View Complete Post

More Related Resource Links

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Intranet Users Challenged When Using Windows Integrated Security


We've setup an intranet site using Windows Integrated Security. Its up and running and users can access it. However, they are being challenged with a login dialog for the server when they initially access the site.

Isn't is possible to configure the server so that the users aren't challenged AND are recognized as being already authenticated by Windows? We're trying to go with a seamless experience, whereby all they have to do is login to their machine like normal and then go from there.

Custom security via connection string

Hi Is it possible to pass information into the SQL Server relational engine via the connection string in the same way as it can be done for Analysis Services? I need to generate a user context for a forms authentication application (i.e. no windows user accounts). SSAS allows you to pass in a list of database roles or a customdata parameter on the connection string. These can be used inside the database in lieu of a windows identity. I am wondering if there are equivalent parameters available for the SQL connection string.  I guess that I could create SQL logins from each of the forms users with a system generated password and then pass the uid and password on the connection string but this seems unnecessarily complicated. Andrew Wiles - www.it-workplace.com - MDX made simple

SSRS2008: no Integrated Security; MOSS integrated; WebfrontEnd separate

Hi, we have the following setup: 2 webfrontend servers MOSS 2007 with RS addin 1 MSSQL 2008 Cluster 1 MSSQL 2008 with Reporting Services installed when trying to use integrated security in the datasource, i receive the exception saying that integrated security is not configured. doing this on a standalone (MOSS, SQL, SSRS) environment everything works. Do I need to configure the usage of integrated security? Maybe Kerberos ? Regards Sven

Subscriptions using Windows Integrated Security (Datasource)

Hi All, Having an issue with SSRS 2008 at the moment, trying to setup subscriptions.Our system is configured so that any one of 10 users can login to the SSRS website using their windows domain account, and then launch report builder to design and save reports.  This all works very well, however, they have a problem when trying to setup subscriptions - the famous "Subscriptions cannot be created because the credentials used to run the report are not stored....."What the message says is true - the credentials are not stored as they are supplied by the user when they login to report builder.Is the /any/ workaround at all that doesn't involve storing the credentials?  It seems totally crazy that they cannot be prompted for them when setting up the subscription.  For this application its 100% essential to make the user provide their credentials when running reports, because they each see a filtered subset of the data in the report model (this is controlled DB side depeding on the login account), so their domain account needs to be passed to SQL server to enable this filtering to work.  If we saved their credentials then they would see all the data..and thats nasty.The only workaround I can come up with would be to create  a separate datasource for each user and upload a separate model, but thats really nasty to be honest and creates an ad

IIS 7 - Integrated security

Hi, I'm trying to use integrated security in IIS7 (Windows 2008) to connect to a database and add some tables as part of a Vistual Studio installer. I've set up my Application Pool so it users a domain user account to run the pool. As part of the installer, I connect to the database and add some tables though it doesn't seem to recognise the Application Pool indentity from the installer. The same method works fine in Windows 2008 R2 but Windows 2008 seems to have issues with this. I know it's a long shot but has anyone got any ideas? Regards Chris 

JDBC and Integrated security

So, I'm still getting errors when configuring a connection with integrated security: and YES, I copied the sqljdbc_auth.dll into system32 directory (and I put a copy into systemWOW64 also.).<---   error message:ect to Development Server.  Error creating SQL Model Connection connection to Development Server. (Error: This driver is not configured for integrated authentication.)  This driver is not configured for integrated authentication.  Error creating JDBC Connection connection to Development Server. (Error: This driver is not configured for integrated authentication.)  This driver is not configured for integrated authentication.end error message --->I'm no expert here, but the message indicates, to me, that it's the *driver* that doesn't support integrated security. WTF? Was this an oversight? Or is something wrong on my side (Win 7, SQL2005, Eclipse Data Tools, sqlJDBC4, both ver 2.0 and v3[CTP]). I saw messages relating back to version 1.2 that this problem would be fixed.Mark

ExecuteReader problem in web form: Connection-property not initialized


I changed my data source from an access-db to a sql-server, now i still have to fix some problems Undecided

When I want to load a value from a sql-database into my web form (to display a default value), I get an ExecuteReader error ("Connection-property not initialized").

I dont know where to set the connection property in my code.

Dim con As New System.Data.SqlClient.SqlConnection()
Dim myCommand As New System.Data.SqlClient.SqlCommand
Dim SqlCon As String = "Data Source=blablabla\SQLEXPRESS;Initial Catalog=Bill;Persist Security Info=True;User ID=xxx;Password=password"
con.ConnectionString = SqlCon
Dim reader As System.Data.SqlClient.SqlDataReader = myCommand.ExecuteReader() 

The error occurs in the last line. Do I have to set the connection property in the SqlCon string?

RowDelimiter property for FlatFile Connection not mapping to a variable correctly


I've ran into the following problem:

I have flat files originating from different systems (MS-DOS, AIX and Windows). Therefore the files have different line endings (CR, LF and CRLF respectively).
I'm using a Script Task inside a ForEach enumerator to find a row delimiter for each file and put the value into a string variable. Then I use Data Flow task to import the data from the flat file into the database. The script task runs fine and sets the variable value to {CR}, {LF} or {CR}{LF} for each file. Columns are delimited with "!" character.

When I map the RowDelimiter property of the FlatFile Connection Manager to the variable using Expressions the subsequent Data Flow task doesn't import the data correctly. I've tried using Format=Delimited and Format=RaggedRight (I removed the last column delimiter), both ways fail to import the data correctly.
Although the mapping of the ConnectionString property to a variable (ForEach populates this variable with the path of the file) works perfectly.

I've even tried setting up all combinations of quotes and brackets on the string variable value ("{CR}", '{CR}', {CR}, CR) ...

The platform  I'm working on is Windows Server 2008 x64 and SQL Server 2008 x64 ...

My current workaround idea is to write a Script Task that would replace all

Connection issue SSAS 2008 (role security)


Hello Experts,

After implement role security based on dimension security we get connection issues at the initial log on to our ssas cube.

Our environment is:
Windows Server 2008 SP2, x64
MS SQL Server 2008 Enterprise SP1
VM-Ware Maschine
Processor: AMD Opteron 8381 HE (QuadCode 2,5GHz)
Memory: 8 GB
Relation database: about 18 GB
Multidimensional database: about 8 GB / 39 Dimension / 68 measure groups (some were needed to implement m:n relations)

Security model: 4 fact tables get 4 additional column e.g. Security1 with values “yes” and “no”. A Role1 e.g. is able to see Security1 only “yes” facts. A Role2 e.g. is able to see Security2 only “yes”

Access report server database connection information from custom security extension



Is there any way from my custom security extension that I can get to and unencrypt the database connection information held within the RSReportServer.config file?



Help me solve this question:Invalid value for key 'integrated security'


I has develop a website using vS10 using Operating system vista and was working well however i apply it at different os which is window 7 it appeared this error

Invalid value for key 'integrated security'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Invalid value for key 'integrated security'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Invalid value for key 'integrated security'

SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated sec


Logon Error: 17806, Severity: 20, State: 2.

SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed.


We are getting this error daily after i logged in to server.Recently we have created new login.So when login through this new one which is not domain one ,we are facing this problm.


kindly help me to remove this error. 

Changing WindowsIdentity creates sql login errors for integrated security connections


I am using winows authentication to connect to a web page and user.identity and principle.windowsidentity are showing as my currently logged in active directory user.  I can successfully connect to SQL Server with a integrated security connection string at this point.

I then prompt the user for login as a different account on the domain and change the principle.windowsidentity to this login using




"advapi32.dll", SetLastError:=True)> Private Shared Function LogonUser(ByVal lpszUsername As String

Passing credentials to run query web service with integrated security

Dear, I want to publish a web service that I perform a query to a db, the problem is that access to the database with integra

Check the if SSAS Roles property is used in excel connection string before returning the values



We are using Excel 2007 to connect to SSAS cubes. We have many roles for a user and all having different permission including different VISUAL TOTAL setting. We want to restrict the user so that he cannot see anything if he is not using the ROLES property in the excel connection string.

At the run time I want to know if the user who is using excel has used ROLES property or not.

Any help will be appreciated

Mr myName

connection property has not been initialized


hi all

i am developing winforms application in c#

My ConnectionString in app.config is 


<add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\UttamPayDB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend