Created
April 16, 2009 07:43
-
-
Save atifaziz/96298 to your computer and use it in GitHub Desktop.
Demonstrates using ConnectionStringEditor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr, sys | |
clr.AddReference('System.Design') | |
from System.Web.UI.Design import ConnectionStringEditor | |
from System.ComponentModel import ITypeDescriptorContext | |
class TypeDescriptorContext(ITypeDescriptorContext): | |
def get_Instance(self): | |
return None | |
Instance = property(get_Instance) | |
def main(args): | |
value = args and args[0] or None | |
context = TypeDescriptorContext() | |
editor = ConnectionStringEditor() | |
print editor.EditValue(context, None, value) | |
if __name__ == '__main__': | |
main(sys.argv[1:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment