This operator allows you to supply an alternative value if the value being supplied is null. It only works on nullable datatypes but with a bit of googling came accross this article.
public int CurrentPage
{
get
{
return (int)(ViewState["_CurrentPage"] ?? 0);
}
set
{
this.ViewState["_CurrentPage"] = value;
}
}
The offical Microsoft article
Here is a great site for helping to choose colour schemes for websites.
Following code iterates through each entry in a dictory
For Each keyPair As KeyValuePair(Of String, Int32) In aDepot.PostcodeCounters
builder.Append("<tr><td>")
builder.Append(keyPair.Key)
builder.Append("</td><td align=""right"">")
builder.Append(keyPair.Value)
builder.Append("</td></tr>")
Next
If you are attempting to add a data connection to a SQL 2005 database within visual studio 2008 you might encounter the following error…
Could not load file or assembly ‘Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91′ or one of its dependencies. The system cannot find the file specified.
You need to install the following…
Microsoft SQL Server System CLR Types
Microsoft SQL Server 2008 Management Objects
They can be found here as part of the SQL Server 2008 Feature Pack.
If you want to get into iPhone development this is a great book to start from Beginning iPhone Development by apress
In Visual Studio 2008 you’ve lost the abillity to click on the drop down in the code behind and see all the event signatures that are available but haven’t handled yet. To get the signature you are after without using the properites in the desinger you can type…
this.
As you hit the . all methods and events should appear, pick the event you after e.g. Load
Then add type += after the event name and press TAB TAB, the event is automatically generated. ASP.Net auto wires the events with the correct name and signature so you should be able to delete the line of code that binds the event.
Check out this article for more info.
@@IDENTITY will return the last id that was created using your connection, therefore if your insert kicks off a trigger you could get the wrong id.
But SCOPE_INDENTITY() will return the last identity created
Normally when you write a server control, .Net automatically wraps the output with a span and the Id of the control. Depending on your CSS this can cause rendering issues. You can use the following technique to prevent the span from being rendered.
public override void RenderBeginTag(HtmlTextWriter writer)
{
using (HtmlTextWriter blankOne = new HtmlTextWriter(new System.IO.StringWriter()))
{
base.RenderBeginTag(blankOne);
}
}
public override void RenderEndTag(HtmlTextWriter writer)
{
}
It basically writes out the open tag to a new HTML Writer and therefore is not part of the final rendered HTML
The following example shows how to perform a delete using an inner join
DELETE
a
FROM
StatementlineassociatedPayment AS a
INNER JOIN
rebatePatientStatementLine AS b
ON
a.StatementlineId = b.Id
INNER JOIN
rebatePatientSummary AS c
ON
b.summaryId = c.Id
WHERE
c.IssueStatus <> 2
If you don’t populate a value in the session of a page then the session Id will reset everytime the page is loaded.
protected void Page_PreInit(object sender, EventArgs e)
{
//Need this line otherwise it resets the Session Id everytime!
Session["keepme"] = "True";
}