Today i observed an interesting thing in this name space I had a file of 713 kb
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
Tuesday, December 7, 2010
ReportViewer Credentials on SQL server 2008 R2
While migrating a project from VS 2005 to VS2010 and to a new version of SQL server i Came across an issue where we need to pass access credentials to the report viewer before showing any report. following code snippet help to resolve exception which will arise if you do not provide reporting server credentials.
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;
}
}
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
Last week i deployed a web application on a new server. the site was containing wordpress blog and posting, when i took the web online i observed that my AJAX toolkit is not working. so i started debugging the problem. after spending couple of days and 30 hours i concluded that it is due to some handler which is not allowing the runtime files to be shown because each time i try to browse a webresource it throw 404 page not found. i was using Windows server 2008 R2 so i observed in the handler that each request which blongs to a web resouce which does not exists is actually routed to php/wordpress engine. who then evalute this request as valid or not so it was my issue. some people suggested that i have to use static url path for web resource which was not possible due to extensive change. so this was the issue
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>
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
ast week we were busy in the deployment package of ERP related installer. There were number of issues that we found in this exercise and I am documenting those for the future reference. Following items were found to be culprit and they need to be taken care during any installer developed for quick books related items.
- 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
Today me and my team is searching for good CRM with compaign managment feature. none of the good software provides all features related to customer requriment. i think we should go for a custom one.
there are not multi compaign fetures and lot more that we need. i have not idea now wat to do.
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
we ll i am posting the same bolg again so it will be more short this time
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
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
Deploying or redeploying Microsoft® CRM 3.0 to a second system is a multi-step process that involves:
· 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:
:\Program Files\Microsoft SQL Server\MSSQL\Data.
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:
:\Documents and Settings\User\Application Data\Microsoft\Microsoft CRM\Logs
Source CD-1 MSCRM server installer Redeployment Guide
· 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
Subscribe to:
Posts (Atom)