DevTech team has released the name of final speakers and their topics here and it seems that I also made the cut to speak at this event. DevTeach / SQLTeach Toronto 2008 will be the biggest developer, DBA and ITPro conference in Canada. It’s jam-packed with advanced sessions (level 300 and 400) all on the latest versions of Microsoft products and technologies. I am presenting two topics in the SharePoint track:
1) Accessing External Data Sources Through SharePoint:
Imagine that your SharePoint sites must contain structured data in a high volume and you need to perform complex queries and actions against it. Obviously, there are pros and cons of storing such information in SharePoint lists or in a custom SQL database. Realistically speaking, neither of these approaches alone nor Business Data Catalog (a.k.a BDC) is the answer to all of your data integration woes. You like the versioning, approval, bulk editing , rich UI and other good features that SharePoint lists offer but you are also concerned about the performance of your complex cross-list queries, CAML limitations (like ‘join’ , ‘Select distinct’) and optimized searching. You need to provide a common metadata repository and a hybrid framework for accessing external data sources through SharePoint utilizing all your options including BDC, Data View Web Part and custom code to keep both data structures in sync. In this session I will show you how you can surface information from your backend databases into your SharePoint sites, when to keep structured data in SharePoint lists and when not and eventually how in real world implementation you will end up combining all your options to come up with a robust solution with much better performance!
2) Forms based authentication in SharePoint with the SQL Server membership provide :
In ASP.NET 2.0 , there is an important concept called provider model which is used for many new feature such as Membership/Role Management, Profiles, etc. SharePoint is built on the top of ASP.NET 2.0 which means it can utilize everything that ASP.NET 2.0 offers including SQL Membership provider. In this session learn how to set this up, get yourself familiar with issues/workarounds, managing your custom profiles and finally how to leverage this solution for exposing your SharePoint sites to external users. This is an advanced session, targeting both IT Pros and Developers and attendees will receive fully commented source code with step-by-step walkthroughs for the exercises shown during demo.
I am moving my entire site along with 3 customer sites to a new host this weekend. I am also adding some e-commerce components to be able to serve my customers better. Hopefully everything goes without a hitch, but there may be some service interruption next week.Once I make the move, I will have a nice story about how some of the web hostings rip off people. Regrettably, some people have no other options except to obey and accept their bullshits , but definitely that’s not the case for me. I am out of here Mr.Servergrid!
The address of my site and blog and also RSS feeds will not change.
I turn on my laptop and the fan starts to spin so fast, also my laptop gets so hot after a short period of time. I called the guy in customer service and he told me that is normal. He also says that laptops get hot and thats why the fan starts to work to cool it down ! Wow, I never knew what laptop fans are for 😉 Very informative phone conversation … I hung up!
I was not convinced so I decided to troubleshoot the issue myself. I opened up the case to have a peek. I noticed that there are so much dust around the fans. This doesn’t let the air to circulate well.
Okay, it seems like someone has something to clean up.
I cleaned up the fan and surprisingly it fixed the problem. Yes, it is not a bad idea if sometimes you pick up the screw driver and try things out yourself.
A web part that has its own toolbar with different controls added to it programmatically is easy to build.
1) Create a web part and override CreateChildControls and Render methods:
public class WPT : WebPart {
protected ToolBar tlb;
protected override void CreateChildControls()
{
base.CreateChildControls();
tlb = (ToolBar)Page.LoadControl("/_controltemplates/ToolBar.ascx");
tlb.ID = "NavNodesTB";
tlb.Template_Buttons = new BtnTemplate();
Controls.Add(tlb);
}
protected override void Render(HtmlTextWriter writer)
{
RenderChildren(writer);
}
}
2) Create the BtnTemplate class that implements ITemplate interface. Add all the controls you want to show up on the toolbar
public class BtnTemplate : ITemplate
{
DropDownList ddlNumbers;
HyperLink tlBarLink;
void ITemplate.InstantiateIn(Control container)
{
tlBarLink = new HyperLink();
tlBarLink.ID = "idClickMeText";
tlBarLink.Text = "Click Me";
tlBarLink.ToolTip = "Click Me";
tlBarLink.NavigateUrl = "javascript:alert('Hello World!')";
ddlNumbers = new DropDownList();
ddlNumbers.ID = "idNumbers";
ddlNumbers.Load += new EventHandler(ddlNumbers_Load);
ddlNumbers.AutoPostBack = false;
container.Controls.Add(tlBarLink);
container.Controls.Add(ddlNumbers);
}
void ddlNumbers_Load(object sender, EventArgs e)
{
ddlNumbers.Items.Clear();
ddlNumbers.Items.Add(new ListItem("One"));
ddlNumbers.Items.Add(new ListItem("Two"));
ddlNumbers.Items.Add(new ListItem("Three"));
}
}
3) Finally,deploy your web part and you are pretty much done! Here is how your web part looks like.
Source Code can be downloaded here.
Update 13/Sep/2008: Another way of adding toolbar is now documented here.
Since I am a lazy developer I normally don’t like to author multiple stored procedures if I can afford to aggregate all the logic in one place without causing too much complexity. For example when working with custom authentication providers you are often required to write separate stored procedures for GetAllUsers, FindUsersByName, FindUsersByEmail that can be called from their counterpart overridden methods in your custom authentication provider’s code. Following example demonstrates how you can have one stored procedure that can handle GetAllUsers, FindUsersByName, FindUsersByEmail logic in one stored procedure. As shown below, @email and @username parameters can be null which means you can ignore these two filters and get all the users instead. One important thing to note is the table that holds all the user information in this example. It is called Contacts with ContactID as the primary key, but yours might be different! Read more…