DevAdmin Blog

Blog di Ermanno Goletto (Microsoft MVP Directory Services - MCITP - MCTS - MCSA - MCP)
posts - 886, comments - 447, trackbacks - 13

My Links

News

Avatar

Curriculum Vitae

Visualizza il profilo di Ermanno Goletto su LinkedIn


Il contenuto di questo blog e di ciascun post viene fornito “così come é”, senza garanzie, e non conferisce alcun diritto. Questo blog riporta il mio personale pensiero che non riflette necessariamente il pensiero del mio datore di lavoro.

Logo Creative Commons Deed


Logo SysAdmin.it SysAdmin.it Staff


Logo TechNet Forum TechNet Italia @ForumTechNetIt Follow TechNet Forum on Twitter


Logo MVP


Ermanno Goletto Follow ermannog on Twitter

Article Categories

Archives

Post Categories

Blogs

Friends

Knowledge Base

MVP Sites

Resources

Riconoscere una stringa OleDb per SQLServer

Un modo per capire se una stringa OleDb si riferisce a SQLServer è quello di controllarne il provider tramite una regular expression:

Public Overloads Shared Function IsSqlConnectionString(ByVal connectionString As String) As Boolean
            Dim regex As New System.Text.RegularExpressions.Regex("Provider\s*=\s*SQLOLEDB[^;]*;", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
            Return regex.IsMatch(connectionString)
End Function

L'idea è ovviamente esensibile ad altri provider.

Print | posted on Sunday, March 28, 2004 12:11 PM | Filed Under [ Code, Snippets & Scripts Database .NET ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 5 and 4 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET