Registering Missing Data Providers with Visual Studio 2012

The original article is located at here

In using the preview releases of Visual Studio 2012, something that eventually became a stumbling block was missing .NET data providers in the IDE. The .NET components themselves can be manually registered in the toolbox, but if you want tooling support (for instance for strongly-typed datasets or EF) you need the data provider registered in the IDE.

At first I switched back to Visual Studio 2010 to do these specific tasks. One of the great features of Visual Studio 2012 is its file compatibility (project round-tripping) with Visual Studio 2010. However, after a few times of doing this I decided there had to be a better way.

I tried Googling around a bit, but most of the references I found were for how component developers canregister their own data providers with the IDE. For me, though, the problem was getting data providers installed that don’t yet have support for the next version of Visual Studio.

My next intuition was to search the registry. So, I fired up regedit, accepting that lovely UAC prompt, and searched for the name of one of the data providers that was registered in Visual Studio 2010 but not Visual Studio 2012 – in my case Advantage Database Server.


In the end there were four relevant results in the following locations:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\DataProviders\
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\DataSources\
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\DataProviders\
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\DataSources\

Under each of these keys are another series of keys with GUID names. Selecting a GUID key will show the details of the data provider (or data source) on the right.


So, to get this single data source & provider registered in the Visual Studio 2012 IDE, I ended up locating the four specific keys to my missing data source & provider (all had the same GUID name, but in each of the above locations), and exporting those registry entries to .reg files with the right-click context menu.


Then, I edited those four .reg files in Notepad, changing any references from “VisualStudio\10.0″ to “VisualStudio\11.0″. Finally, after saving, I double-clicked each of the four .reg files, accepting the small army of dialogs, and fired up Visual Studio 2012. Adding a new data source showed that the data providers were now registered and working.


I may end up writing a little utility for doing this with the ability to target any version of Visual Studio but, until then, the above steps are pretty simple (if not a little manual).

Update: Thanks to user ieaglle for pointing out that the HKLM paths will be different if you are running a 64-bit edition of Windows. The paths are:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataSources\

Update #2: Thanks again to user ieaglle for pointing out that additional keys must be taken into consideration for SQLite. The paths are:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\Packages\
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\Services\

How to send iPhone In-App SMS

You can use a sms:[target phone number] URL to open the SMS application, but you cannot prefill a SMS body with text.

[[UIApplication sharedApplication] openURL: @"sms:12345678"];

Or you can use MFMessageComposeViewController from iOS sdk, below is how to use it, or you can download the sample code from apple developer center(http://developer.apple.com/library/ios/#samplecode/MessageComposer/)

- (void)showSMSPicker {     Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));     if (messageClass != nil) {                 // Check whether the current device is configured for sending SMS messages         if ([messageClass canSendText]) {            [self displaySMSComposerSheet];         }     } } - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {         //feedbackMsg.hidden = NO;     // Notifies users about errors associated with the interface     switch (result)     {         case MessageComposeResultCancelled:         {             UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"Message" message:@"SMS sending canceled!!!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];             [alert1 show];             [alert1 release];         }           // feedbackMsg.text = @"Result: SMS sending canceled";         break;         case MessageComposeResultSent:         {             UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:@"Message" message:@"SMS sent!!!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];             [alert2 show];             [alert2 release];         }           // feedbackMsg.text = @"Result: SMS sent";         break;         case MessageComposeResultFailed:         {             UIAlertView *alert3 = [[UIAlertView alloc] initWithTitle:@"Message" message:@"SMS sending failed!!!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];             [alert3 show];             [alert3 release];         }           // feedbackMsg.text = @"Result: SMS sending failed";         break;         default:         {             UIAlertView *alert4 = [[UIAlertView alloc] initWithTitle:@"Message" message:@"SMS not sent!!!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];             [alert4 show];             [alert4 release];         }           // feedbackMsg.text = @"Result: SMS not sent";         break;     }     [self dismissModalViewControllerAnimated: YES]; }

SET THE CONTENTS OF AN IFRAME USING JQUERY

I needed to do some magical AJAXy previewing (inline) for an email templating system I’m building that generates both text and HTML versions of an email. For displaying the HTML version of the email inline I was using an iFrame. Using jQuery to do an AJAX post of the template, I then needed to render the response inline, and essentially wanted to just replace the HTML contents of an iFrame with the HTML response I received back from my AJAX jQuery post.

I found this tidbit from Twig’s Tech Tips, which did exactly what I wanted. Using an iFrame like this (no src attribute):

<iframe id=”preview-iframe” width=”320″ height=”240″></iframe>
You can use this jQuery call to replace the contents of the iFrame:

$(‘#preview-iframe’).contents().find(‘html’).html(data);