SELECT Percent of records from table using TABLESAMPLE

Filed in Uncategorized Leave a comment

SELECT *

FROM GL TABLESAMPLE SYSTEM (10 PERCENT) ;

sum of a column in datatable c#

Filed in Uncategorized Leave a comment

DataTable table;
table = ds.Tables["Ordertable"]
Double dblTotalCost = Convert.ToDouble(table.Compute(“SUM(SalesPriceMoney)”, “”));
if (dblTotalCost > 0)
lblTotalCost.Text = dblTotalCost.ToString(“C”);
else
lblTotalCost.Text = “$0.00″;

Split each email address seperated by semi colon

Filed in Uncategorized Leave a comment

MailMessage mm = new MailMessage();
string strEmails = “abcccs22@domain.com; sd22321@gasd3mail.com; s2s33@gdasdsdmail.com;”;

string[] emails = strEmails.Split(‘;’);
foreach (string email in emails)
{
if (email.Trim() != string.Empty)
{
mm.ReplyToList.Add(new MailAddress(email));
}
}

PTCL Freedom Unlimited Package in comparison with Double Up Unlimited Package

Filed in Uncategorized Leave a comment

Below is the analysis on new PTCL Freedom Unlimited Package in comparison with old Double Up Unlimited Package. I did it for the DSL subscribers and obviously some plus and minus are possible in it.

With 1 MB DSL 

Total Bill Rs. 1750: New Package with 1 MB DSL (1200 DSL, 250 Fixed, 300 Tax approx)
Total Bill Rs. 2200: New Package with 1 MB DSL and (Smart TV RS.449)
Total Bill Rs. 2330: Double Up Package charges for same

With 2 MB DSL 

Total Bill Rs. 2050: New Package with 2 MB DSL (1500 DSL, 250 Fixed, 350 Tax approx)
Total Bill Rs. 2500: New Package with 2 MB DSL and (Smart TV RS.449)
Total Bill Rs. 2650: Double Up Package charges for same

Smart TV facility charges is free in Double up package and if you are paying any device charges that would be added in the above amount. PCTL to PTCL Local, Nation wide and Vfone calls are unlimited in the above packages. Standard rates would apply for the calls on Mobile, International or any other network. The only draw back of this new Freedom Unlimited Package is that cell phone calls from your land line in Double Up Unlimited package is half rated from standard. But you can add Mobile bundle package with it.

Be aware !!! Once you opt for this new package you can’t come back to Double Up Unlimited package.

There is some thing good for the simple land line customers also (without DSL)  who do PCTL to PTCL Local, Nation wide and Vfone calls. Around in Rs 700 you can do it unlimited.

P.S: I tried my best in calculating above rate but I am not responsible for any any mistake in above calculation.

Referene: PTCL official website

Excel formula for String manipulation

Filed in Uncategorized Leave a comment

For converting “CId = @CId” to CId = ISNULL(@CId, CId)” in excel below is the formula:

=CONCATENATE(MID(F2,1,(FIND(“@”,F2)-1)),” ISNULL(“,MID(F2,FIND(“@”,F2),LEN(F2)),”, “,MID(F2,FIND(“@”,F2)+1,LEN(F2)), “)”)

Requested registry access is not allowed

Filed in Uncategorized Comments Off

Problem: Requested registry access is not allowed.

Solution: Following error is related to eConnect occurs due to missing registry entries. If these entries are missing this problem will occur and can be resolved by manually creating these. These entries can be found in registry at path “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog”. At the above location, key named ‘eConnect’ should be present which contains two further keys named ‘eConnect’ and ‘eConnect_API’. Both these keys must contain a value named ‘EventMessageFile’ with data ‘C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\EventLogMessages.dll’. If these keys exist then Event Viewer displays eConnect entry in which you can see econnect specific errors. All above is applicable up to version 9.0 in version 10.0 they have change the key hierarchy.

Again thanks to my friend Faraz who resove this issue.

,

The transaction has already been implicitly or explicitly committed or aborted MS Dynamics Great Plains econnect

Filed in Uncategorized Leave a comment

Problem: The transaction has already been implicitly or explicitly committed or aborted. This error normally comes when there is some problem in the network connection. I got this error when I am doing transactions using MS Dynamics Great Plains econnect in my application from my PC to another PC on the network. My one friend Faraz gave me below solution and it works.

Solution: Add enlist=false in the connection string. Connection string would be like this;

ConnectionString = @”data source=SERVERNAME;initial catalog=DBNAME;integrated security=SSPI;persist security info=False;packet size=4096;enlist=false”;

, ,

Duplicate Asset ID and Suffix Error When Adding a New Asset

Filed in Uncategorized Comments Off

Problem: Duplicate Asset ID and Suffix Error When Adding a New Asset. This problem is related to Microsoft Great Plain FA module. I found this error in GP 7.5 and 9.0

Solution: Take backup of your database depending on your condition.  Run a delete statement on the FAINDEX in your Company database. “Delete FROM FAINDEX”

,

The partner transaction manager has disabled its support for remote/network transactions

Filed in Uncategorized Comments Off

Problem:The partner transaction manager has disabled its support for remote/network transactions. An error occurred while enlisting in a distributed transaction.

Solution: This error comes up when you are doing inter sever transactions via Distributed Transaction Cordinator MSDTC. You need to set some setting on your machine.

In Control Panel > Adminstrative Tools > Component Services > Expand Component Service > Right Click My Computers > Properties > MSTDC Tab > Click on Security Configuration button > Check Network DTC if not checked and Check Allow Inbound, Allow Outbound and select NO AUTHENTICATION REQUIRED.

, ,

Specified owner name 'dbo' either does not exist or you do not have permission to use it

Filed in Uncategorized Comments Off

I found this error when I try to get or insert into Microsoft Dynamics Great Plains through eConnect.

Problem: {System.Data.SqlClient.SqlError: Specified owner name ‘dbo’ either does not exist or you do not have permission to use it.} object {System.Data.SqlClient.SqlError}

Solution: First of all domain user should be added in your SQL Server Logins. Give db_owner Role to that domian user in SQL Server through which you give call to SQL Server via eConnect, this is the same user through which you install eConnect service when installing eConnect. I found it as a one time problem you can revert it after the sucessful calls of all entities, probebly first time it is create some db object for which it requires some extra previllages, this is the same user with which you install eConnect service and your GP transaction are done by this user.

, ,

TOP