Archive for the 'Technology' Category

3rd MS Kapihan

What supposed to be a Saturday event turned out as a holiday event. With the President declared Tuesday as a national holiday, the MVPs who met last Wednesday finalized the next MS Kapihan session will be held on the holiday and this time in Subic. This is my second kapihan session as I missed the first one since I have a class back then in UP and we were so delayed in schedule that I cannot afford to skip another Saturday. Everyone who joined came in at SM North Edsa yesterday to join a van convoy going to Subic. With members of the community as well as some Microsoft Student Partners, we embarked a 2+ hours travel to Subic via SCTEX. This is my second time to pass by SCTEX and unfortunately, I witnessed another accident along the road.

The topics discussed in this kapihan session revolved around the Microsoft Azure Platform. This is one of the topics I am particularly interested in aside from the topic covered during the second MS Kapihan that revolved around Windows Phone 7. The discussion kicked-off by myself, discussing the free add-on for Visual Studio 2010 that makes development much more transparent and easier to track methods in one of the features that it have – the Productivity Power Tools for Visual Studio 2010.

As someone who is more into coding, I find this tool helpful especially the Solution Navigation which I think is the feature that benefit me most. Locating the definitions for the methods I use, properties within the class, the classes where they are defined, parameters and return value are made easy using this one. The window docks itself in the same location where Solution Explorer is located. There’s also a search bar that loops  through the files associated with the currently loaded project/solution.

After the discussion on the tools, it was followed through by MVPs Allan Mangune and John Delizo covering some tools on testing included in the Ultimate SKU of Visual Studio 2010 as well as working with continuous integration with Visual Studio 2010 Team Foundation Server. One of the community members, Joey de Jesus, also discussed the database tools included in the same SKU of Visual Studio.

The main topic on Azure was started by MVP Roman Canlas focusing on the fundamentals of the Azure Platform, components in a nutshell and a brief discussion on the Storage Services. There’s a discussion among the developers and with my delight, the MSPs also participated in the discussion based from their own experience. Honestly, this one is an interesting technology on my part considering that most major players in the IT field are leveraging time, resources, and investments on this type of platform. Aside from Microsoft, other players are Amazon, Google, and IBM to name a few have their own distinct implementations that caters to different cloud computing needs. As for my part, it would be more logical for me to work on the Microsoft platform as most of my development experience leans more on this. After the discussion, lunch was served, and as people who doesn’t love technology but also doing fun, we had another set of photo shooting within the freeport premises and the kulitan by the main building.

This kapihan brought back some of the familiar faces in the Microsoft community. Referred to as the “chief”, Jerome Punzalan, the first president of the Philippine .NET Users group was there to participate and give his insights on the discussion. Also, there are some members as well from Philippine Windows Users Group were there to listen and have their opinions aired. Participation in MS Kapihan is free and I think the next venue would be in Quezon City.

Suggestions? 🙂

Advertisements

GridView To DataSet To Excel

Cross Posted From Here

My weekend was a bit busy as I am working on a small project and one of the requirements that I have been doing is converting GridView data to an Excel document. I checked the resources in the internet and I can’t seem to find anything that fits my need. Things become more difficult as I am working on dynamic GridViews where the number of GridViews that would be displayed on a certain instance depends on the value that will be returned by the query as well as the text in some of the cells that it should contain.

Researching further, I found an article converting DataSets to Microsoft Excel without the use of COM objects. This would be a good headstart to keep things rolling. Though, I found no explicit API that allows me to convert GridView data to DataSets. Moreover, I do customizations on display on my GridView so I prefer to have an exported data that outputs the same content in the Excel worksheet as on my screen.

GridView objects have an event called RowDataBound and this allows the developer to access the value of the fields before it is displayed in a GridView. This is quite helpful in cases wherein if you want to customize display text in a BoundField column from a bit-typed DataField source rather than from a default true/false display to something more descriptive (which in case in an ordering system, display “Delivered/Not Yet Delivered” than a “true/false” value). Having that in mind, I played with the event and created a dynamic DataTable out of the value rendered in the GridView. In my example, I used the Northwind database and queried the Customers table with a SqlDataSource. There are 2 GridViews in my form where the first one consumes the result of the SqlDataSource and the other one that will consume the generated DataSet (I have a decided to append my generated DataTable to a DataSet so that I can consume the code indicated above) from the first GridView.

Continue reading ‘GridView To DataSet To Excel’

ASP.NET Membership Database Migration Helper

This is my project born out of a problem on how to backup the existing data that I have on a website. In one of my projects, I have created a user registration system based on ASP.NET Membership although as I reach the peak of the limits of the database hosting, I need a means to transfer the data from that database to another.

Unfortunately, the original database host of my old project didn’t allow me to connect to the database via SQL Server Management Studio and it would be a pain to manually gather the membership information and maintain its integrity particularly the password if the Membership provider configuration for the password is set to “Hashed”.

I tried searching if there’s an API for programaticaly migrating data but I haven’t found one. Solutions found over the net include backing up the database and restore it in a local store but I find that tedious. I need something that is as much as possible with less clicks. With that, this application is an attempt to solve that problem.

Directions:

1. Start with Start.aspx (Default.aspx will eventually redirect you to that page). Provide the following information:

a) Source Database Connection String
b) Source Database Application Name
c) Target Database Connection String
d) Target Database Application Name

a & c are obvious reasons why you need to provide them. “b” is needed since we need to specify what specific application database are we backing up. Typically, the ASPNETDB.mdf file that is being created whenever we fire up the Website Administration Tool (WSAT) can handle users for use with Membership for different web applications by virtue of applicationId. This can be verified by opening the aspnet_Applications table. On the other hand “c” is needed since we need to check that the database doesn’t contain that application name as it might overwrite any existing data in there (in cases you want to merge Membership databases).

2. Clicking validate will validate the information that you have provided. Until such time all entries appear to be valid, then it would only be at that period you can click on the “Export >>” button that will perform the actual migration. Likewise, once validated, you can also delete or clear the target database of all it’s entries.

WARNING:

Be aware only that this action is irreversible and there’s no way of backing it up unless you have a spare copy of that database somewhere else.

3. You would be informed in Result.aspx if the migration is okay or not. TryExport.aspx is actually the page that I made to test if the export is working or not. Before trying it out, do the following:

  • Modify web.config by editing the connection string list and the provider list. Edit the connection string section first as the providers will depend on the entries of this section. This application is by default populated with two providers namely: AspNetSqlMembershipProvider (source) and ExportedDBMembershipProvider (destination). The connection string attribute of the provider should match that of the connection string name of the source/destination databases. Failure to do so will prohibit you from validating if the export works or not.
  • The applicationName attribute of the destination provider should match the “Target Application Name” specified in Start.aspx. Failure to do so will prohibit you again from validating if the export works or not.
  • You can change the name of the providers and will allow you to validate however, you need to change as well the values set in the code-behind of TryExport.aspx for the provider name.

Additional Notes:

  • I tested the code to work when transporting between two SQL Server 2005 Express database files. However, the application might throw an error when the data is too big to transfer.
  • This application just exports the application data, membership information and roles. I am still making a way to include the Profile data (if there’s any) to the exported database.

The file is in zip format but since wordpress is not accepting ZIP files as attachment, you can download it here and rename it to .zip.

Comments, reactions, suggestions? Post a comment here!

How To: Fix ‘YMSGR’ is Undefined

My .NET Framework 3.5 SP1 wasn’t a smooth one as I had to go through different levels of cleaning up .NET framework installation registries before I can install it. On top of that, I also had to remove previous components of pre-SP1 release as these might conflict with the installation.

After all the hullabaloo, I shutdown my machine and returned to work the next day. To my dismay, after successfully logging on to Yahoo Messenger, I can accept messages from contacts (and non-contacts/spam) but I can’t read their messages. It took me a while to recognize the problem. I tried uninstalling/reinstalling the program but that failed.

Solution:

Running through the Microsoft Script Debugger, I found out that the chat window is some sort of HTML page enclosed within the program. That chat window have some scripts included so I guess that it follows the DOM that IE follows. So, I have to use one button I often see in IE options but never dared to click on it. No wonder, that’s the only button I had to click to clear that error.

Hope this helps. Though it still keeps me wondering if the SP1 installation has triggered this error. Everything has been fixed but I have to reinstall the IE developer toolbar, as well as the “Web Development Helper” toolbar of Nikhil Kothari.

Where I Was Last Weekend

Like what I mentioned in my previous blog entry, I was in Subic last weekend of another ASP.NET talk. The talk went well only that it was after my talk I was reminded that I spoke for an hour and a half. No wonder I got carried away with my talk knowing that the venue is really a good place to talk. Even if my laptop malfunctioned before my talk (function key isn’t working until I brutally force it to work), the audience were delighted with the topic I presented.

All in all, we have 67 persons in attendance and at least 30 of them were students (though I think they comprise majority of the audience).

After spending 2 consecutive weekends out of Manila, I will be having a rest this week but hopefully can get around after. You can read the organization’s write-up here. I just realized, I should learn how to smile again in front of the camera. 😛

Surprise!

I received an e-mail from Microsoft informing me that I was awarded as a Microsoft Most Valuable Professional for the ASP/ASP.NET technical communities for the July 2008 cycle.

As the official site states:

Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community’s best and brightest, and they share a deep commitment to community and a willingness to help others.

Good news do really come after the bad ones. My laptop just got broken as well as my camera is now malfunctioning. Talk about good riddance.

Nonetheless, again, thanks to all who supported me and in all the endeavors that made this possible. Ad astra per aspera!

Fully Booked!

My remaining June weekends are fully booked. I will be out of Manila this Saturday and next Saturday. However, the last week isn’t work related as the former but it would be a nice activity moving up north doing talks on .NET technologies.

I will be talking about ASP.NET 3.5 for the Subic Olongapo IT Society. Basing from the website, a lot of them have worked with Joomla (in PHP) so I guess my talk would play around comparison between web development in PHP and ASP.NET. Having worked on PHP for 4 years would be a good backgrounder for introducing ASP.NET to the PHP developer. 🙂

And my moonlighting projects aren’t done yet. Poor me. 😦


Blog Stats

  • 3,978 hits
October 2017
S M T W T F S
« Nov    
1234567
891011121314
15161718192021
22232425262728
293031