About Zu

Posts by Zu:

 
0

Dynamic MS SQL 2005 Stored Procedure Parameters

on March 16, 2011 in .Net, SQL
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.

 
0

.NET DateTime Picker

on December 29, 2010 in .Net

im my endless search for an DateTime Picker i have finally found one that’s awesome: http://www.basicdatepicker.com/download/downloadproduct.aspx

 
0

SQL JOINs

on November 29, 2010 in SQL

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 [...]

 
0

Migrate user Transactions

on November 10, 2010 in .Net, Ektron

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     [...]

 
0

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

on October 1, 2010 in SQL

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 [...]

 
0

Insert into Smart Form

on September 23, 2010 in Ektron

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)

 
0

Display Library Assets (Files)

on September 17, 2010 in Ektron

Dim libraryApi As New API.Library() ‘API.Library libraryApi = new API.Library(); Dim data() As LibraryData Dim totalPages As Integer Try data = libraryApi.GetAllChildLibItems("quicklinks", [id], "", 0, 0, totalPages) If ((data IsNot Nothing)) AndAlso (data.Length &gt; 0) Then ‘Dim item As LibraryData = Nothing Dim str As String = "" For Each item As LibraryData In data [...]

 
1

Upload library assets

on September 17, 2010 in Ektron

‘ Dim myFile2 = FileName.Text.ToLower Dim myFile As HttpPostedFile = DMSfile.PostedFile ‘add myDMSAssets as folder in site root directory DMSfile.PostedFile.SaveAs(Server.MapPath("~/path/") &amp; myFile.FileName) Dim fs As New System.IO.FileStream(Server.MapPath("~/path/" &amp; myFile.FileName), IO.FileMode.Open) Dim UpdateFile As New Ektron.Cms.AssetUpdateData UpdateFile.FileName = myFile.FileName UpdateFile.LanguageId = 1033 ‘add a folder in the WorkArea for DMS documents UpdateFile.FolderId = UpdateFile.Title = myFile.FileName [...]

 
0

Insert Products

on September 17, 2010 in Ektron

‘Add product Types (sub categories) Dim catalogApi As New CatalogEntryApi() Dim productTypeApi As New ProductTypeApi() Dim inventoryAPI As New InventoryApi() Dim dr As SqlDataReader Dim currentUserId As Long = catalogApi.UserId Dim Currency_USD As Integer = 840 ‘ Create and Populate ApplicantDetails If currentUserId &gt; 0 Then Dim folderId As Long = 0 Long.TryParse([folder id], folderId) [...]

 
0

Insert into HTML Form

on September 17, 2010 in Ektron

Dim cApi As New Ektron.Cms.ContentAPI() Dim fSubData As New FormSubmittedData() Dim userapi As Ektron.Cms.UserAPI = New Ektron.Cms.UserAPI() Dim fDataItem As FormFieldDataItem() = New FormFieldDataItem(1) {} fDataItem(0) = New FormFieldDataItem() fDataItem(0).FieldName = "EmployerID" fDataItem(0).DataValue = txtid.text fDataItem(1) = New FormFieldDataItem() fDataItem(1).FieldName = "JobTitle" fDataItem(1).DataValue = txtJobTitle.Text fSubData.DataItems = fDataItem fSubData.DateSubmitted = Now.Date() Try cApi.SubmitFormFieldData([form id], fSubData, [...]

Copyright © 2007-2012 Cheat Sheet All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.