Archive for the '.NET pasaule' Category

Sharepoint, MOSS un WSS – 2007. versija

Wednesday, November 22nd, 2006

Šķiet, esmu viens no retajiem LV, kuram šīs lietas vispār interesē, tomēr pastāstīšu – lai jau saglabājas nākotnei. Kopš šī gada sākuma tīmeklī it bieži tiek pieminēts “jaunais Sharepoint” – visvairāk kā apjūsmojoši ieraksti dažādos blogos, cik ērts gan tas būs. Runa ir par Sharepoint 2007, precīzāk, diviem Sharepoint saimes produktiem – Windows Sharepoint Services [...]

Always, ALWAYS initialize!

Friday, October 20th, 2006

What output would you expect from such a piece of code (VB.net, of course): Imports System.Globalization …. Dim CurrentCalendar As System.Globalization.Calendar = _ CultureInfo.CurrentUICulture.Calendar ‘We want to output all the dates in the current year for every month. For iMonth As Integer = 1 To 12 Dim sOutput As String ‘accumulate all the dates For [...]

IsUserInGroup updated

Thursday, May 11th, 2006

In an earlier article I’ve been talkin about how to check if a user belongs to a specific domain group. However, the code in that article doesn’t work on local groups and WinNT ADSI provider. I’ve made an update to the code posted there, this should work both on domain and local groups. Usage: If [...]

cmdSave.Enabled = False

Wednesday, January 11th, 2006

Nemaz nav prātīgi domāt, ka, ASP.Net kontrole (piemēram, poga), kas it kā ir “atspējota” (disabled, not enabled), patiesībā tāda ir. Vienīgais, ko patiesībā ASP.Net izdara, ir, ģenerējot HTML kodu, kontroles kodā ieraksta disabled=true. Taču, ja šo pogu klienta pusē atkal “iespējojam” (eneiblojam), piemēram, ar šāda te: javascript:( function(){ d=document; l=d.getElementsByTagName(“INPUT”); for(var i=0;i<l.length;i++){ l[i].disabled=false} }()) JavaScript [...]

Finding SPListItem by its ID

Monday, December 19th, 2005

I just found out that some operations in my SharePoint application run quite slow when used on lists containing large amounts of listitems. In the particular case it was approximately 2,500 items in the list. The result is: NEVER use this code construction to find an element by its ID: oList = oWeb.Lists(“LongList”) ‘gets the [...]

SPUser? SPException!

Thursday, October 13th, 2005

Something on SharePoint(TM) again. Either you love it or hate it, you have to work around all the pitfalls anyway. So we all know that in SharePoint you can allow people and assign them SharePoint roles in two ways: creating a “Sharepoint User” within the portal and assigning roles to the user, adding a domain [...]

Does this user belong to that domain group?

Thursday, October 13th, 2005

A naivist-approach solution to check if a user belongs to a particular domain group.

Calculated fields in CAML

Monday, September 26th, 2005

So you have a SharePoint list with a calculated field. You want to select items based on the calculated field beginning with some specific substring. You write a CAML query: <Where> <BeginsWith> <FieldRef Name=”SortDate” /> <Value Type=”Calculated”>200509</Value> </BeginsWith> </Where> This won’t work. (At least on my server) you’d always get informed that ” The SQL [...]

Month names. i18n, you know

Monday, September 26th, 2005

Whenever you see something like this you should come to an idea something is wrong (for instance, the guy who wrote this is still alive): ‘month names in Latvian Dim sMonth() As String = _ {“Janvāris”, “Februāris”, “Marts”, “Aprīlis”, _ “Maijs”, “Jūnijs”, “Jūlijs”, “Augusts”, _ “Septembris”, “Oktobris”, “Novembris”, “Decembris”} Dim oListItem as ListItem For iMonth [...]

Parse the Enum!

Wednesday, September 14th, 2005

What if we need to save the value of an instance of an enumeration (Enum) as string and then get back the value again? For instance, we have the following code: Dim eDay As System.DayOfWeek = DayOfWeek.Monday So now we can get a textual representation of eDay using the built-in ToString() method: MessageBox.Show(eDay.ToString()) This yields [...]