Find what DNS the MicroStrategy Intelligence Server currently uses

go to the registry:

LOCAL_MACHINE -> SOFTWARE-> Wow6432Node -> MicroStrategy->Data Sources ->CastorServer -> Location variable

Posted in MicroStrategy | Tagged | Leave a comment

Migrating MicroStrategy Project to a different Version

On the Source server

  • Create blank SQL (or whatever) database.
  • Create metadata
    • Configuration Wizard -> “Create Metadata, History List, and …” -> select “Metadata Tables”
  • Duplicate original project into a DIRECT source (select meta data created in step 2)

On the Destination Server

  • Create new Direct project source and point to the metadata you just created.
  • Run Configuration wizard on the Destination Server
    • Configure Intelligence server – > select  metadata of the project you are converting-> go through the configuration process
    • Upgrade existing environment -> Intelligence Server Components -> go through the configuration process (no need to check “history tables” in this step)
  • Run Configuration wizard on the Destination Server, and point back to the original metadata definition.
  • Duplicate your upgraded Direct project into the main 3-tier data source.
Posted in MicroStrategy | Leave a comment

LDAP Search Filters

To test Search Filter:

in Active Directory

View -> Filter Options -> Create Custom -> Advanced

To show members of a group:

(&(objectCategory=user)(MemberOf=CN=YourGroupName,OU=Groups,DC=full,DC=domain,DC=name,DC=gov))



Posted in LDAP | Leave a comment

Friendly Session Time out Message

<BODY  onload=’beginSessionTimer();’>
<script type=”text/javascript”>
<!–
function redirect(url) {
window.location = url;
}
function ShowTimeoutWarning ()
{
window.alert( “You will be logged out due to inactivity in 5 minutes. If you are working on something, please save your work now to prevent data loss!” );
}
function beginSessionTimer() {
// 30000ms = 30s
// 300000ms = 5 minutes
//   window.setTimeout(redirect, 30000,
//             “http://www.yoursite.com/login.asp?session=clear”);
window.setTimeout(‘ShowTimeoutWarning();’, 300000)
}
//–>
</script>
Posted in ASP | Leave a comment

Dynamic MS SQL 2005 Stored Procedure Parameters

I had a function in my .NET application, that needed to do a search with an unknown number of parameters.
for example:
 select * from tbl where x=1 or x=2 or x=3 or x=4
Solution:

Pass in a comma seperated list, use a table function to split that out into a table and then use an IN clause. This article goes over doing that.
Posted in .Net, SQL | Leave a comment

.NET DateTime Picker

im my endless search for an DateTime Picker i have finally found one that’s awesome:

http://www.basicdatepicker.com/download/downloadproduct.aspx

Posted in .Net | Leave a comment

SQL JOINs

Assuming you’re joining on columns with no duplicates, which is by far the most common case:

  • An inner join of A and B gives the result of A intersect B, i.e. the inner part of a venn diagram intersection.
  • An outer join of A and B gives the results of A union B, i.e. the outer parts of a venn diagram union.

Examples

Suppose you have two Tables, with a single column each, and data as follows:

A    B -    - 1    3 2    4 3    5 4    6

Note that (1,2) are unique to A, (3,4) are common, and (5,6) are unique to B.

Continue reading

Posted in SQL | Leave a comment

Migrate user Transactions

make sure people don’t get charged by changing testmode=true in the web.config.

I am using authorize.net test CC information for this.

Dim catalogApi As New CatalogEntryApi()
        Dim evtAPI As New Ektron.Cms.Framework.Calendar.WebEvent()

        Dim bapi As New BasketApi
        Dim oAPI As New OrderApi
        Dim uAPI As New CustomerApi
        Dim usAPI As New UserAPI
        Dim userId As Integer

        Dim connStr As String = ConfigurationManager.ConnectionStrings("DbConnection").ConnectionString
        Dim myConnection As SqlConnection = New SqlConnection(connStr)
        Dim sql As String = "select something from something "
        Dim myCommand As SqlCommand = New SqlCommand(sql, myConnection)
        Dim dr As SqlDataReader

        Try
            ‘ Execute the command
           myConnection.Open()
            dr = myCommand.ExecuteReader()

            ‘ Make sure a record was returned
           While dr.Read()
                userId = usAPI.GetUserByUsername(dr("username")).Id
                Dim udata As CustomerData = uAPI.GetItem(userId)

                Dim oData As New OrderData
                Dim aApi As New AddressApi
                Dim cAPI As New CountryApi
                Dim rApi As New RegionApi

                ‘set address from DB
               Dim adata As New AddressData
                Dim cdata As New CountryData
                Dim rdata As New RegionData

                adata.AddressLine1 = dr("street")
                adata.City = dr("city").ToString
                ‘set country data
               cdata = cAPI.GetItem(840) ‘USA
               adata.Country = cdata
                adata.IsValidated = True
                adata.Name = dr("first_name").ToString & " " & dr("last_name").ToString
                adata.Phone = dr("daytime_phone").ToString
                If (dr("zip").ToString = "") Then
                    adata.PostalCode = "00000"
                Else
                    adata.PostalCode = dr("zip").ToString
                End If

                ‘set region data
               Dim rCriterial As New Ektron.Cms.Common.Criteria(Of RegionProperty)
                Dim rRegion As Generic.List(Of RegionData)
                rCriterial.AddFilter(RegionProperty.AlphaCode, CriteriaFilterOperator.EqualTo, dr("state"))
                rRegion = rApi.GetList(rCriterial)
                For Each r As RegionData In rRegion
                    rdata = rApi.GetItem(r.Id)
                Next
                ‘if state does not match, set it to maryland
               If rdata.Id = 0 Then
                    rdata = rApi.GetItem(21)
                End If
                adata.Region = rdata
                adata.Validate()
                ‘add address to customer
               Dim aID As Long = aApi.Add(adata)
                uAPI.ChangeBillingAddress(userId, aID)
                uAPI.ChangeShippingAddress(userId, aID)
     
                ‘Default payment CC for everyone
               Dim payment As New CreditCardPayment()
                Dim expDate As New CCExpirationDate
                expDate.Month = EkEnumeration.CCExpirationMonth.July
                expDate.Year = 2013
                payment.ExpirationDate = expDate
                payment.Number = "4007000000000"
                payment.CCID = "000"

                Dim basket As Ektron.Cms.Commerce.Basket
                Try
                    basket = bapi.GetDefaultBasket(udata.Id)

                    ‘find class ID based on SKU
                   Dim cCriteria As New Ektron.Cms.Common.Criteria(Of EntryProperty)
                    Dim cClass As Generic.List(Of EntryData)
                    Dim classID As Integer
                    cCriteria.AddFilter(EntryProperty.Sku, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, dr("event_id").ToString)
                    cClass = catalogApi.GetList(cCriteria)
                    For Each c As EntryData In cClass
                        basket.AddProduct(c.Id)
                        classID = c.Id
                    Next

                    basket.ShippingAddressId = udata.ShippingAddressId
 
                    ‘process order
                   oData = oAPI.PlaceOrder(basket.Id, userId, aID, aID, basket.ShippingMethodId, payment, "", "")

                    ‘update class inventory
                   Dim iAPI As New InventoryApi()
                    Dim iData As InventoryData
                    iData = iAPI.GetInventory(classID)
                    iData.UnitsInStock = iData.UnitsInStock – 1
                    iAPI.SaveInventory(iData)

                    ‘add seat names to class order
                   Dim contentApi As New Ektron.Cms.ContentAPI
                    contentApi.AddContentRating(classID, userId, 0, dr("seat_name") & " – " & dr("seat_email"), True)
                    lblMessage.Text += "<br> great success" & oData.Customer.UserName & " OrderID:" & oData.Id & " eventID:" & dr("event_id").ToString
                Catch ex As Exception
                    lblMessage.Text += "<br>" & oData.Customer.UserName & ex.Message
                End Try
            End While
        Catch ex As Exception
            lblMessage.Text += "<br>" & ex.Message

        End Try

Posted in .Net, Ektron | Leave a comment

Text was truncated or one or more characters had no match in the target code page.

I’ve run into this problem many many times already.

here is a workaround?

1. save the excel as either tab delimited or pipe delimited.

(the problem here is that it ads quotes to the import, but thats easily fixable later….)

update table
set fieldName= replace(fieldName, ‘"’, ”)
where fieldName2= 188

2. select Flat file as the source in SSIS
3. change data types and sizes in Advanced
4. Import and done.

Posted in SQL | Leave a comment

Insert into Smart Form

Dim capi2 AS New API.Content.Content
        Dim XMLID AS Integer = 278
        Dim folderID AS Integer = 71697
        capi2.AddContent(txtJobTitle.Text, "hello", "<root><JobTitle>" & txtJobTitle.Text & "</JobTitle></root>", "hello", "1033", "", folderID, "", "", "", XMLID, -1, False)
Posted in Ektron | Leave a comment