People who do not have consistent internet connection can download complete ISO of SP1 from following link instead of web installer.
This blog purly contains information and tips related to the issues a developer face in daily life.
Wednesday, December 8, 2010
How-to: Query XML Column Using value
Using SQL Server 2005, I am trying to perform a query on a table that has an
XML column type.
I want to return rows that contain a value within the XML, however it is not
working.
See query below:
SELECT *
FROM XMLTable
WHERE XMLCol.value('(/Method/Methods/@LowLimit)[1]', 'int') = 5
The XML in the column is:
<Method xmlns="http://tempuri.org/Method.xsd">
<Methods>
<Key>1</Key>
<Name>PKI</Name>
<DateCreated>2006-05-01T00:00:00-04:00</DateCreated>
<DateModified>2006-05-02T00:00:00-04:00</DateModified>
<LowLimit>5</LowLimit>
<HighLimit>10</HighLimit>
</Methods>
<SubMethod>
<Key>1</Key>
<Pressure>10</Pressure>
<Temperature>25</Temperature>
</SubMethod>
</Method>
Solution
WITH XMLNAMESPACES(DEFAULT 'http://tempuri.org/Method.xsd' )
SELECT *
FROM XMLTable
WHERE XMLCol.value('(/Method/Methods/LowLimit)[1]', 'int') = 5
Problem 2
Also I have been trying to query on the similar XML but the current query
using the value() method stops at the first XML tag it sees and doesn't check
the remaiming,.
See XML below.
There is more than one "<Methods>" however using the query:
WITH XMLNAMESPACES(DEFAULT 'http://tempuri.org/Method.xsd' )
SELECT *
FROM XMLTable
WHERE XMLCol.value('(/Method/Methods/HighLimit)[1]', 'int') = 32
It only sees the first "<Methods>" not the ones below it.
I have tried ti use the FLWOR with no success.
How can the query using the vaiue() method be used to propagte down?
If I bump up the the number to 2 in the WHERE clause it only sees the second
"<Methods>" then it will return the row where HighLimt = 32:
WHERE XMLCol.value('(/Method/Methods/HighLimit)[2]', 'int') = 32
Thanks for any help.
<Method xmlns="http://tempuri.org/Method.xsd">
<Methods>
<Key>3</Key>
<Name>Joe</Name>
<DateCreated>2005-07-09T00:00:00-04:00</DateCreated>
<DateModified>2006-03-15T00:00:00-05:00</DateModified>
<LowLimit>1</LowLimit>
<HighLimit>8</HighLimit>
</Methods>
<Methods>
<Key>4</Key>
<Name>Mary</Name>
<DateCreated>0200-05-12T00:00:00-04:00</DateCreated>
<DateModified>2004-07-30T00:00:00-04:00</DateModified>
<LowLimit>18</LowLimit>
<HighLimit>32</HighLimit>
</Methods>
<SubMethod>
<Key>1</Key>
<Pressure>10</Pressure>
<Temperature>25</Temperature>
</SubMethod>
<SubMethod>
<Key>2</Key>
<Pressure>20</Pressure>
<Temperature>100</Temperature>
</SubMethod>
</Method>
Solution 2
Have found (through DataPoints download
http://msdn.microsoft.com/msdnmag/issues/06/03/DataPoints/default.aspx)
can use the exists() method to perfom the search throughout the XML document:
WHERE XMLCol.exist('/Method/Methods/LowLimit[contains(.,"18")]') = 1
My Tip do not mention namespace if you don’t have any Schema for your XML
Performance optimization of a Virtual Machine
Everyone uses Virtual machine now a days some as development environment others as testing environment. however many users who are not using latest HyperV technology still face slow performances for the VM. in my opinion following things can improve the performance of a VM
- Stop all unnecessary services. like indexing services or SQL server related services if not required.
- if you do not need network do select the option no local area network. it impacts a lot since the congestion on LAN make the VM a non responsive.
- make sure you are using unique name for the VM over LAN to avoid continuous network errors.like duplicate name
- increase the page file size so that host could easily process the VM data.
- make sure that from VM software options you are using following options for best performances.
Infragistics Ultra Web grid Hidden property
in web application we need to hide show rows in an infragistics. web grid initially property hidden was used for this purpose however in version 10.2 now its a method setHidden which is used to hide or show a Row in infragitcs web grid.
as per documentation
Sets the row visibility. Boolean. True to hide row.
Source setHidden
BizTalk Mapping with Multiple Source and Destination Schemas
If you are already familiar with the BizTalk Mapper tool within Visual Studio, you probably already know that it is easy to create a .btm map file in the BizTalk project, select a single source schema and a single destination schema, and then create your map graphically. However, what if you have multiple schemas that you want to aggregate them into a single destination schema, or better yet, into multiple destination schemas. It is not obvious how you can accomplish this in the mapping tool since it doesn’t seem to allow you to select more than one schemas, either source or destination, when you create the map. Actually, this can be accomplished with the help of an helper orchestration.
Here are the steps as an example:
- Create 4 schemas, name them source1, source2, destination1 and destination2 respectively.
- Instead of creating a map file (.btm) directly, create a new orchestration (.odx) file. This will be your helper orchestration and you can discard it after you are done.
- Inside the helper orchestration, create 4 messages, assigning them with the 4 schemas you create in step 1 respectively.
- Grab an Transform shape and throw it onto the orchestration designer surface.
- Double-click on the Transform shape, now you are in the Transformation Configuration dialog box.
- Make sure “New Map” checkbox is selected, then type in the map name you’d like.
- Add source1 and source2 messages as the Source of the Transformation.
- Then add destination1 and destination2 messages as the Destination of the Transformation.
- Make sure “When I click OK, launch the BizTalk Mapper” checkbox is selected.
- Hit OK. A new map will be created for you with Source1 and Source2 as source schemas under a single root record, and destination1 and destination2 as destination schemas under a single root record as well. Now you can go ahead design this map to your heart’s content.
- Optionally, again, you can delete the helper orchestration.
Unfortunately there is still no direct way to create this kind of maps in BizTalk Mapper. But with the help of an orchestration Transformation shape you can accomplish this as a work-around.
Ultra webgrid Row Numbering
Today i had to add some row numbers to an ultrawebgrid although it was simple but now a day infragistics support is really not good so you have explore and implement. during research i come to know that there is a property of AllowRowNumberingDefault in displayLayout section of grid is responsible to Row numbers. now if you want this row number to be continues over several pages you need to set is AllowRowNumberingDefault = "Continuous" . this property is also available at band level so that you could set it on a certain band level. now if you want to use the row number at client side you need to set another property in displayout section with name EnableClientSideRenumbering = "true" it can also be set at band level in some version but in my case where i am using 2007.2 it was only at displayout section.
one more thing to remember when trying to show Row numbering you need to set rowselector property to true otherwise these number will not appear because the row number is displayed on selector of the row.
Tuesday, December 7, 2010
Allow more than one remote desktop session for Windows server administrator
Scenario:
Solution:
Source
IIS 7.5 clickonce application Config error
which simply means that file is in restricted extensions.
so to resolved this issue i went to IIS manager then website then request filtering and then i added .config ext as allowed type. in file names extension tab.
remember to use this only when there is nothing special in the config files.
this can also be done by web.config using following article.
http://www.petefreitag.com/item/741.cfm
Crystal Reports Viewer in Sharepoint
I have created sharepoint 2007 web application and deployed it to the server, whcih have some reports. All Reports are working fine on Production site, but the Navigation images in toolbar of Crystal Reports. I pasted aspnet_client folder to Sharepoint site directory as well as in root Directory too. but havn't got that images. then i made virtual directory and gave permissions, but still not getting images on toolbar.
Solution
it usually causes problem better to use webpart for crystal reporting available here
http://jsiegmund.wordpress.com/2007/08/20/crystal-reports-web-part-for-moss-2007/
or
http://beta.codeproject.com/KB/sharepoint/CustomCRWP2.aspx?msg=3288957
follwoing actions willl also help to show images if aboove both not work
Solution 1:
1. In your WebPart override Render method. Within this override extract output HTML and replace “CrystalImageHandler.aspx” with something like this “CrystalImageHandler.xxx”. Render new HTML.
2. In web.config replace CrystalImageHandler.aspx with CrystalImageHandler.xxx within
Now all CR image requests will be processed by CrystalDecisions.Web.CrystalImageHandler. I think this solution is pretty self-explanatory. Let me know if you need the source code on how to alter output HTML within Render override.
Unfortunately, SP team still did not allow us to have any httpHander tags in the web.config, so they suggested to create a layout page called CrystalImageHandler.aspx (goes into _layouts directory), inherit that page from our own class and process image request programmatically. So, here is
Solution 2:
Within code behind of CrystalImageHandler.aspx page on Page_Load event place this code:
Dim hndlr As New CrystalDecisions.Web.CrystalImageHandler
hndlr.ProcessRequest(Context)
You will still have to override Render method of your WebPart and replace CrystalImageHandler.aspx path with something that will look like this:
sNewHTML = Regex.Replace(sCurrentHTML, “/CrystalImageHandler.aspx”, “/_layouts/your_folder_within_layouts_directory/CrystalImageHandler.aspx”).
Now you need to delete httpHandler tag from web.config.
------------------------
Rename the CrystalImageHandler.aspx file to a different extension, so the MOSS handler won’t pick it up. Offcourse you’ll have to alter the web.config to include a handler to the correct file.
Place a custom made CrystalImageHandler.aspx file in the TEMPLATE/LAYOUTS directory of the 12 hyve. Now write a regex which will replace all calls to the old imagehandler with a call to that file which will be in the _layouts directory of your web app.
Blue Screen Error when update to SPS 2007
http://go.microsoft.com/fwlink/?LinkId=70848
ADO.NET hierarchical data from database
Public Function ReceiveDataSet(ByVal CategoryID As String) As DataSet
Try
'Get the data from database and put it in the DataSet
Dim nwindConn As OleDbConnection = New OleDbConnection("Provider=MSDataShape;Data Provider=SQLOLEDB;" & _
"Data Source=.;Integrated Security=SSPI;Initial Catalog=northwind; user id=sa; password=123")
Dim custDA As OleDbDataAdapter = New OleDbDataAdapter("SHAPE {SELECT CategoryID, CategoryName FROM Categories where categoryID=" & CategoryID & "} " & _
" APPEND ({SELECT * FROM Products} AS Products " & _
" RELATE CategoryID TO CategoryID)", nwindConn)
Dim custDS As DataSet = New DataSet
custDA.Fill(custDS, "Categories")
Return custDS
Catch ex As Exception
HttpContext.Current.Response.Write(ex.ToString)
End Try
changing CD Key visual studio trial team suite
this will save your time to redownload all 3.2 GB from subscribers download site.
NET System.IO.Compression and zip files
When i compressed this file it got a new side of 738KB and when I decompressed this file again it got 712 kb. interestingly file sized increased which I observed on many forum.
http://www.eggheadcafe.com/articles/20011231.asp
http://dotnetslackers.com/Microsoft/re-25702_NET_System_IO_Compression_and_zip_files.aspx
http://pluralsight.com/blogs/craig/archive/2004/03/19/1266.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=179704&SiteID=1
http://blogs.wdevs.com/marcclifton/archive/2005/11/22/11303.aspx
some lines from my code. i think i am too old to play with code now
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sf As System.IO.FileStream = New System.IO.FileStream("c:\test1.doc", FileMode.Open)
Dim ds As System.IO.FileStream = New System.IO.FileStream("C:\test2.doc", FileMode.CreateNew)
Dim Compressedfile As System.IO.Compression.GZipStream = New System.IO.Compression.GZipStream(sf, CompressionMode.Decompress)
'Dim byteData(sf.Length) As Byte
'sf.Read(byteData, 0, sf.Length)
'Compressedfile.Write(byteData, 0, byteData.Length)
'Dim destinationfile(Compressedfile.Length) As Byte
'Compressedfile.Read(destinationfile, 0, destinationfile.Length)
'Dim sw As StreamWriter = New StreamWriter(ds)
'sw.Write(destinationfile, 0, destinationfile.Length)
'ds.Write(destinationfile, 0, destinationfile.Length)
'ds.Close()
Dim data As Object
Do
data = CType(Compressedfile.ReadByte(), Integer)
If (CType(data, Integer) = -1) Then
Exit Do
End If
ds.WriteByte(CType(data, Byte))
Loop While (CType(data, Integer) <> -1)
End Sub
ReportViewer Credentials on SQL server 2008 R2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;
using System.Net;
///
/// Summary description for CustomReportCredentials
///
[Serializable]
public class CustomReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials
{
// local variable for network credential.
private string _UserName;
private string _PassWord;
private string _DomainName;
public CustomReportCredentials(string UserName, string PassWord, string DomainName)
{
_UserName = UserName;
_PassWord = PassWord;
_DomainName = DomainName;
}
public WindowsIdentity ImpersonationUser
{
get
{
return null; // not use ImpersonationUser
}
}
public ICredentials NetworkCredentials
{
get
{
// use NetworkCredentials
return new NetworkCredential(_UserName, _PassWord, _DomainName);
}
}
public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)
{
// not use FormsCredentials unless you have implements a custom autentication.
authCookie = null;
user = password = authority = null;
return false;
}
}
Monday, December 6, 2010
IIS 7.5 WebResource.axd and ScriptResource.axd not found
script src="/ScriptResource.axd?d=6jlaIZUKRXg3wAiiwb5CXRLLE4-Gm23NRJYO6UGKsEfKVWmmRDjpjYUxUQc3rzA15AxvjFMTyyBHnHZwnp436Rh4PelOuGVzY5dYg0oEc1rFylLCCtLPLtzdaF9l9sPZW6Nu8_s0HdGhCknizdMILSk85R81&t=634213836780000000" type="text/javascript".
many solution like these
http://stackoverflow.com/questions/3822733/ajaxtoolkit-iis7-asp-net-4-0-sys-is-not-defined-handler-mapping-issue
http://efreedom.com/Question/1-3822733/AjaxToolkit-IIS7-AspNet-40-Sys-Defined
http://geekswithblogs.net/lorint/archive/2007/03/28/110161.aspx
http://geekswithblogs.net/ranganh/archive/2007/07/15/113963.aspx
so looked over the net for the solution since it has been many days i could not remember the linke but following the solution.
in web.config section System.webservrer
<rewrite> <rules> <rule name="wordpress" patternsyntax="ECMAScript">
<match url=".*"> <conditions> <add negate="true" input="{REQUEST_FILENAME}"
matchtype="IsFile"> <add negate="true" input="{REQUEST_FILENAME}" matchtype="IsDirectory">
<add negate="true" input="{URL}" pattern="\.axd$"> </conditions> <action
url="index.php" type="Rewrite"> </rule>
Tuesday, January 15, 2008
QuickBooks dependent client application installers
- Qbfc6.dll is a dynamic link library which is a COM component. Ideally all component can be copied anywhere in the computer as per definition of COM and they are accessible to other applications. But unfortunately qbfc6.dll can only be registered in program files –> common files–> QuickBooks folder. The reason of the problem is that dll entry point qbfc6.dll is located in some other module. So any installer which is using qbfc6.dll must have the ability to register this dll from above mentioned location. So far no document available for this problem.
- QBFC merge module is the second area which needs to be focused. As per documentation this merge module is responsible to install and copy the interops (inter-operatablity .net wrappers) and copy/register COM objects to the location mentioned above. But in actual merge modules only copy the files to the location and they do not register any component.
- If you have installed QBSDK 7.0 there are three different versions of Interop files. By default these interops are registered to global assembly cache but no documentation is available which describes this feature of these interop files. These versions are 6.0.0.174, 7.0.0.134, 6.0.0.137 no SDK document mentions that a new version qbfc6.dll interop is a part of QBSDK 7.0.
- You can create interop of any COM file by just adding the reference of COM to your .net project but in case of qbfc6.dll you have to use the interops provided by quickbooks not the one generated by VS 2005.
So any installer which is developed for QuickBooks related project must be able to copy the qbfc6.dll to common files, and then register from this location. All QBFC Interops must be register to GAC (global assembly cache) and they should be available at application path for the applications. All project using QBFC 6.0 must use the itnerops developed by QuickBooks not the one generated by VS 2005.
Friday, December 7, 2007
Compaing managment tool
there are not multi compaign fetures and lot more that we need. i have not idea now wat to do.
BizTalk 2006 is unable to validate the Char data Type of SQL server 2005
the problem is if you use generated items from SQL adapter for a stored procedure with Char data type as parameter or you use an update gram with char data type of SQL server you will be unable to validate the generated schema. i observed this thing couple of months back so thought to share it with other.
the resolution is to change either the data type of the table field if your table filed is not critical or change the type of Stored procedure parameter. alternatively you can change the data type of schema from Char to xs:string
hope everybody will be able to understand it
Thursday, June 7, 2007
MS CRM migration/redeployment to new domain servers
· Several manual procedures
· The use of standard backup and restore procedures and utilities
· A wizard designed specifically for this process
The wizard is the Microsoft CRM Redeployment Wizard. Using this wizard and the processes described in this document, a
system administrator or software developer can copy and use their Microsoft CRM data in another Microsoft CRM
implementation separate from the original system.
The following are some examples of redeployments that you can make using these tools, processes, and procedures.
On a separate Microsoft CRM implementation with its own Active Directory forest and domain that is not connected to
the original Active Directory forest and domain.
Step 1: Back Up the Databases
Make a copy of or back up the Microsoft CRM databases. Perform the following tasks before copying the databases:
Step 2: (Optional) Back Up Customizations, Workflow, and Custom Reports
Important: Customizations, workflow, and customized reports are not redeployed using the Redeployment Tool. If you want your redeployed Microsoft CRM system to have the customizations, workflow rules, or custom reports from your source Microsoft CRM system, you must back them up manually and restore them to your redeployed system manually.
Step 3: Install Servers and Configure Users
Install all server applications for your new implementation, including:
• Active Directory domain controllers
• Microsoft SQL Server
• Microsoft Exchange Server (optional)
Step 4: Restore the Microsoft CRM Databases
Step 5: Complete the Microsoft CRM Redeployment Wizard
Step 6: Install Microsoft CRM
Install Microsoft CRM on the computer in the new system and make sure to select the Connect to existing database option during setup. Each Microsoft CRM implementation must have the appropriate license.
Step 7: (Optional) Import Customizations,
Workflow Rules, and Custom Reports
Known Issues
Microsoft Windows Operating System Additions and Database Triggers
If you want to install any Microsoft Windows® operating system enhancements or “add-on” programs or create or add any
custom database triggers (other than system defaults) to your new Microsoft CRM system, you must install them before
using the Microsoft CRM Redeployment Wizard. If you have installed the “add-on” programs or added any custom
database triggers, you must remove them, complete the redeployment process on the new Microsoft CRM system, and then
re-install them after you have verified that the new Microsoft CRM system is functioning.
The Microsoft CRM Redeployment Wizard Does Not Finish
If, for any reason, the Microsoft CRM Redeployment Wizard does not complete, you will need to do the following:
1. Delete the Organization_MSCRM and Organization_METABASE databases on the Microsoft SQL Server of your
new deployment. These database files should be located in the folder:
2. Start the redeployment process again at Step 4 in this document.
Installing Microsoft CRM Server always creates a log files that can be reviewed and used for troubleshooting. By default,
the location of the log files is:
Source CD-1 MSCRM server installer Redeployment Guide
Monday, May 7, 2007
RTHDCPL.EXE - Illegal System DLL Relocation
i think Realteck Audio is unable to initialize and throws error some sort of
---------------------------
RTHDCPL.EXE - Illegal System DLL Relocation
---------------------------
The system DLL user32.dll was relocated in memory. The application will not run properly. The relocation occurred because the DLL C:\WINDOWS\system32\HHCTRL.OCX occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL.
---------------------------
OK
---------------------------
the problem finally resolved by installing a patch mentioned on the follwing page
http://support.microsoft.com/default.aspx/kb/935448/
interestingly Microsoft patch worked this time