Greetings Folks,
Microsoft is excited to bring 19 Sessions to DevTeach from TechDays 2011. The sessions come from 7 focus areas including:
Those of you who would like to avail a $100 discount (and why wouldn't you!), you could use the rebate code T00000NTUG up until the day of the event. Is this a treat or what? :)
TechDays 2011 sessions at DevTeach will address a multitude of topics like Building a Security Skeleton for your ASP.NET Applications, Application Development with HTML5, Migrating to Windows Server 2008 R2, What’s new in SQL Server Code-Named “Denali” and Building Your Own Private Cloud Infrastructure. For a full list of sessions and to see the abstracts, please visit the session listing and schedule.
In order to the most out of your time at DevTeach Ottawa, we suggest you do the following prior to the presentations:
Download or activate free trials of the software that we’ll be covering in the presentations, so you can try it out ahead of time:
Visit the MSDN and TechNet sites to do some pre-reading on the latest news and information on the topics that will be covered.
Looking forward to seeing you November 2nd to 4th in Ottawa!
Obi />
After manually deleting records, truncating the table and then dropping the table one at a time (being an old-fashioned and to some extent anal) I was left with a stack of stored procedures that I had to clean up as well.
I was in no mood to go through dropping them one at a time, so here’s what I found to drop all stored procedures using a cursor:
Method 1.
declare @procName varchar(500)
declare cur cursor
for select [name] from sys.objects where type = 'p'
open cur
fetch next from cur into @procName
while @@fetch_status = 0
begin
exec('drop procedure ' + @procName)
fetch next from cur into @procName
end
close cur
deallocate cur
Method 2 (This method yet simple will give you a better control of the sp’s you want to nuke by creating/viewing a list first)
SELECT 'DROP PROCEDURE ' + p.NAME FROM sys.procedures p
Cheers,
Obi />
I’ve already bought my Tech·Days ticket for this Fall – Don’t Miss your chance to come out to join me and save using my User Group promo code.
Greeting Folks,
I’m excited to let you know that this year, I’ll be attending Tech·Days Toronto this fall. Tech·Days is Microsoft’s premier technical training conference for Developers and IT Professionals. I am passionate about Microsoft technologies and always enjoy meeting and connecting with other Canadian technical professionals.
Tech·Days is a great opportunity for you and your team to enhance your technology skills by getting up to speed on the latest Microsoft technologies, and learning how to maximize your use of the current technologies in your organization.
Check out the three Tech·Days events this year and register today using my special User Group promo Code: TD2011UG and you can get your ticket for only $399.99*. That’s nearly 50% off the regular price of $799.99.
Toronto October 25-26, 2011 Toronto Congress Centre
Vancouver November 15-16, 2011 Vancouver Convention Centre
Montreal November 29-30, 2011 Montreal Palais des congrès
Buy your tickets now >>
This year’s Tech·Days promises to have a great line up of technical sessions and networking opportunities to help you enhance your skills and grow in your career. The first list of 2011 sessions have been posted on the TechDays website. Check them out. This year the team has made a few enhancements to make Tech·Days even better:
-
NEW!Hands-on lab sessions to experience the technology first hand
-
NEW!The Partner Pavilion in each city, providing you with opportunities to network with partners and sponsors
-
NEW!Keynote presentations in each cityfrom awesome technology experts
I look forward to connecting with you this year at Tech·Days 2011!
Sincerely,
Obi Oberoi (Principal Developer Evangelist)
Do you have a constant thirst for knowledge?
Would you like to have access to the newest books on leading edge technologies?
Would you like it even more if these books were available to you for free?
Do you love sharing your opinions with others?
If you answered yes to any of those questions, then sign up to become a blogger for O'Reilly and receive the latest ebooks for free. Read a book, post a review on your blog, and link it to the O'Reilly site. It's that easy! More information can be found online at: http://oreilly.com/bloggers/
Visual Studio LightSwitch is the simplest way to build business applications for the desktop and cloud. LightSwitch simplifies the development process by letting you concentrate on the business logic, while LightSwitch handles the common tasks for you. In this demo-heavy session, see end-to-end how to build and deploy a data-centric business application using LightSwitch. Finally, see how to take advantage of the underlying LightSwitch application architecture to implement your application’s custom business logic.
When: Sept. 8th, 2011
Where: North York Public Library
Time: 6:00 pm registration - 6:30pm start
North Toronto Dot Net User Group
See you there!
Obi />
I was looking for an eBook and found this site.
These guys allow for a free download...check it out:
www.free-ebooks-download.orgWebsite to download latest free e-books on C#, vb.net, asp.net, 2.0, ado.net, sql 2005, web services, ajax, .net framework, compact framework, xml, sharepoint, exchange server, seo, crystal reports and more.. All free ebooks download, Hurry!
If you are a web developer like me, then I am sure you have used QueryString collection at some stage. Although ASP.Net offers some nifty ways to transfer data, but regardless, there are still many situations in which you need to pass data from one web page to another.
In one of my recent projects, I had the need to build a generic template. This template contained a data grid view control that was responsible for building and populating the grid dynamically from twenty different objects. Each object had an unknown number of columns. So every time I had to pass values from one page to another, I couldn’t think of anything better but to use a query string.
While Query string has its benefits, it also has shortcomings.
If you want to pass single or multiple parameters so long as you pass name value pairs, query string really shines. However, when you start to pass 500 or so bytes of data assigned to a parameter, things can get rather nasty. It will most likely throw an exception I hope you get the picture.
lnk.NavigateUrl = "~/MyProject/" & TargetForm & "?Id=" + sMyId + _
"&Code=" + sCode + "&Description=" + Server.HtmlEncode(sDesc) + _
"&SeqNum=" + sSeqNum + "&ActiveInd=" + sActiveInd + _
"&ParentId=" + ParentId + "&Name=" + sName
While the above will work so long as you don’t fill the description with over 500 bytes of data.
As a good measure, you can do a check before passing the data as such:
if (sDesc.Length > 550) {
sDesc = string.Empty;
}
Now in the target page, check to see description’s length is 0. If so, get the data directly from the database to avoid a potential crash like so:
if (Request.QueryString("Description") != null) {
sDesc = Server.HtmlEncode(Request.QueryString("Description").ToString);
if (sDesc.Length == 0) {
sDesc = getDescriptionByID(sId);
}
}
Obi />
I recently ran into a problem where I needed to connect to SQL 2005 from inside SQL 2008 Management Studio.
I have SQL 2008 installed on my machine and I run my sql scripts against the production environment which is hosted by my ISP.
Although, the configuration is pretty straight-forward, however, if not done often, it can turn into oblivion.
This blog post is mainly a reminder to me in case I re-image my hard-drive and have to repeat the process.
Here are the following steps:
- Inside SQL 2008 Management Studio, highlight Database(s) node. You will notice on the right hand pane, there are five columns, namely Name, Policy Health State, Recovery Model, Compatibility Level and Owner.
- Highlight the ‘Name’ column and right click on it, uncheck
Collation.
- Now, try to reconnect or simply refresh.
- You should see all available data bases on the shared server.
Cheers,
Obi />
I am currently working with Telerik’s RAD Editor server control for ASP.Net.
Needless to say, the control provides a plethora of features for styling, formatting and such.
For all intents and purposes it’s a WYSIWIG tool and you can do practically anything what you can with MS Word. All said and done, however, it does not provide any out-of-the-box functionality to convert the editor's content to MS Word.
What you can do though is to save the editor content as an .html file, read the entire content into a string and open it in MS Word.
If you want to edit the .html content, you can even go as far as doing a simple string replacement.
Here’s the code that does just that…
Private folderPath As String = "C:/Report/"
Private template As String = "MyMemo.DOT"
Protected Sub SaveRADContentAsHTML()
Try
' CREATE WORD DOCUMENT
Dim WordApp = CreateObject("word.application")
Dim WordDoc = WordApp.Documents.Open(Server.MapPath(folderPath & template))
WordApp.Application.Visible = False
Dim wordDocPath As String = Server.MapPath(folderPath)
If Not File.Exists(Server.MapPath(folderPath & " MyMemo.html")) Then
WordDoc.SaveAs(wordDocPath & "MyMemo.html")
End If
WordDoc.Close()
WordApp.Quit()
WordDoc = Nothing
WordApp = Nothing
Catch ex As Exception
Throw ex
End Try
End Sub
Private Sub btnReplaceWord_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReplaceWord.Click
Dim wordDocPath As String = Server.MapPath(folderPath)
Dim inputText As String = String.Empty
Dim sTemp As String = String.Empty
Try
inputText = ReadFile(wordDocPath & "MyMemo.html")
sTemp = inputText.Replace("Purpose~1", radEditor1.Content) 'Please note the string "Purpose~1" is used as a marker for string replacement
Using sw As New StreamWriter(Server.MapPath(folderPath & "Test1.html"))
sw.Write(sTemp)
End Using
Catch ex As Exception
Throw ex
End Try
End Sub
Protected Function ReadFile(ByVal myFilePath As String) As String
Try
If Not File.Exists(myFilePath) Then
Return String.Empty
End If
Using sr As New StreamReader(myFilePath)
Return sr.ReadToEnd()
End Using
Catch ex As Exception
Throw ex
End Try
End Function
On June 17th, I gave a talk on LINQ TO SQL Stored Procedures at Manulife.
Below, please see a link to the sample code that I used for demonstration:
http://www.eoberoi.com/blogs/GrokTalk/sourcecode.html
Thanks,
Obi />
I have recently jumped on the AJAX bandwagon and am frantically trying to AJAX enable all my web pages through the use of asynchronous partial-page updates.
A typical design pattern of an ASP.NET AJAX application involves it consuming web services directly from the client without requiring postbacks to the web server. Not only do postbacks slow down an application, but they also complicate the application design, implementation, and deployment.
AJAX is so addictive and such a compelling technology that once you have gotten the hang of it, it is hard to refrain from using it.
However, all said and done, there are some pitfalls that one ought to be aware of.
This blog post is certainly not intended for what AJAX can or can’t do, but if you are looking to convert your web page and make them AJAX enabled, there are a few things you have got to keep in mind just in case you are stuck.
I had a web page with input controls on a panel all of which were wired to the validator controls. In addition, I also had a FileUpload control.
Prior to AJAX enabling the web page, everything was fine and dandy, but the minute I wrapped the asp panel in an Update Panel, everything worked but the FileUpload. In that, the control (FileUpload) did not detect the file name and returned an empty string when checking for FileUpload.HasFile.
The solution to the problem was not difficult either.
In the markup, essentially all that was missing was the PostBackTrigger with the ControlID="btnSubmit".
So essentially, all that is happening now is that we are forcing a post back on the click event of the button while everything else happens asynchronously using the Update Panel. So, when the user presses the button, the page gets refreshed and filename is detected.
My next area of interest is JavaScript Object Notation (JSON). This is just another piece of functionality that is part of the AJAX Extension toolkit typically used for serializing and deserializing data. It is somewhat akin to XML/SOAP, except that JSON is a text-based data interchange format which delivers a more consistent experience due to the implementation differences of XML/SOAP by the various browsers.
Cheers,
Obi />
It is amazing how much you can achieve with Lambda expressions using a single line of code vs. several lines of Linq to Sql.
Although, linq to sql is a better choice over traditional CRUD operations using sql and the like.
Here's how...
Create a new console application project in VS.Net 2008 and import the following name spaces in the module:
Imports System.Collections
Imports System.Linq
Let's declare an array of string as below:
Dim Provinces As String() = {"Ontario", "New Brunswick", "British Columbia", "PEI", "Quebec", "Manitoba", "Alberta", "Northern Territories"}
Using LINQ to SQL, iterate through the array list and write the result to a console as below:
Dim oProvince = From s In Provinces _
Where (s.StartsWith("N")) _
Select s
For Each province In oProvince
Console.WriteLine(province)
Next
Console.ReadLine()
See the number of lines it took to display the provinces beginning with "N"!!!
With Lambda expressions, all of this can be achieved in a single line of code. See below:
For Each prov In Provinces.Where(Function(p) p.StartsWith("N"))
Console.WriteLine(prov)
Next
Console.ReadLine()
Lambda expressions are very powerful which take anonymous delegates to give you the desired result.
While I use LINQ TO SQL where necessary but don't miss a chance when it comes to Lambda expression usage.
Cheers,
Obi />
TechDays is happening in Toronto.
Tech Days is a technology training conference for Canadian IT professionals and developers.
Although, it is a national event and will be held in all major cities of Canada with a single and two day workshops, however, it will be a two day event in Toronto.
I am taking some time off work to attend this event. With five tracks from Windows, Web, Data Management etc., my main emphasis will be on the Web and Windows tracks with topics like AJAX for ASP.Net, Silverlight, WPF and MVC framework.
I think, it is a compelling event with early-bird fee of just $249 which also includes breakfast and lunch.
For further information or to register, click the url below:
www.microsoft.com/canada/techdays
Cheers,
Obi />
Recently what appeared to a be a problem with IE 7.0 on my Lenovo T61p drove me up the wall. Every time, I would open a second instance of the browser, it would not only freeze the browser but also all the active windows on my machine!!! I later found out that it was the "Shockwave Flash Object" by Adobe that was the culprit. So overcome this otherwise annoying problem, in IE 7.0 I went to Tools - Manage Add-ons - Enable or Disable Add-ons and disabled the "Shockwave Flash Object" and voila... This action seems to have fixed my problem wherein I can now have multiple instances of IE or for that matter have multiple tab pages in a single instance of IE 7.0.
Cheers,
Obi Oberoi
Here are some of the predictions of what future holds for the industry software in 2008.
1. User Experience Reaches the Enterprise. In 2008 we will see several major enterprises start efforts to build UX centric applications that increase worker productivity, reduced transaction costs and increase pull through as the UX meme of the consumer facing world leaks into the enterprise. The days of the battleship gray, forms of data application as the king of the enterprise are numbered because of an imperative towards richer visualization of complex and interconnected data. While there will always be a need for the traditional sort of application, by the end of 2008, it is no longer the only element of the corporate landscape.
2. Testability Becomes a Requirement for Software Development Frameworks. No longer satisfied with simple reductions in costs for initial development, a growing community demand frameworks and tools that facilitate sustainable and agile practices. 2008 is the year that frameworks and tools take notice and start to deliver solutions that are testable out of the box. Technologies such as Test Driven Development, MVC/MVP patterns, and frameworks that support mocking become mainstream. After seeing this year’s cool demos at software development industry conferences a common question will be: “...And how do you test that?” Let’s hope the presenters have an answer.
3. The Companion Applications Become Practical. While RIA and AJAX application categories continue to grow, many consumer facing web applications and enterprise applications developers realize there is a need for desktop exploitive applications as well as reach web applications that work everywhere. What meaningful application wouldn’t benefit from a pairing like that of Outlook and Outlook Web Access? In the past it has been prohibitively expensive to build these applications, but with the circa 2008 technology such as .NET Framework 3.5 and Silverlight, it is finally becoming practical to have a single codebase that fully exploits the desktop and offers a rich web experience.
Obi Oberoi