Skip to content

Instantly share code, notes, and snippets.

@atifaziz
Created April 16, 2009 07:43
Show Gist options
  • Save atifaziz/96298 to your computer and use it in GitHub Desktop.
Save atifaziz/96298 to your computer and use it in GitHub Desktop.
Demonstrates using ConnectionStringEditor
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