Showing posts from December, 2016

data-tech FaxMan,FaxMan Jr and interfax alternative for sending fax

Last couple of day i spend time on sending Fax in C#.
i just find out 2 service provider can send fax.

data-tech's FaxMan or FaxMan Jr 

and 3rd party web api

data-tech Fax SDK is not working on windows 10 and interfax API is not free for sending fax.

You easily send fax using Faxcomlib. for details please check the sample.

Thank you.

Common T-SQL

Recently i have completed  online training program on T-SQL from Edx.
I just share in my blog that will cover all basic T-SQL.

-- Display all columns for all customers SELECT * FROM SalesLT.Customer; -- Display customer name fields SELECT Title, FirstName, MiddleName, LastName, Suffix FROM SalesLT.Customer; -- Display title and last name with phone number SELECT Salesperson, Title + ' ' + LastName AS CustomerName, Phone FROM SalesLT.Customer;

-- Customer Companies SELECT CAST(CustomerID AS varchar) + ': ' + CompanyName AS CustomerCompany FROM SalesLT.Customer; --Sales Order Revisions SELECT SalesOrderNumber + ' (' + STR(RevisionNumber, 1) + ')' AS OrderRevision, CONVERT(nvarchar(30), OrderDate, 102) AS OrderDate FROM SalesLT.SalesOrderHeader;

-- Get middle names if known SELECT FirstName + ' ' + ISNULL(MiddleName + ' ', '')+ LastName AS CustomerName FROM SalesLT.Customer;…

The function import 'DBEntities' cannot be executed because it is not mapped to a store function.

1. Open EDMX in to Design Mode
2. Click Model Browser then type the Store procedure name on search and press Enter.
   It will highlight the store procedure.

3. If you already try to add this store procedure, then in some case it create Function when you have a return value on your SP.  other wise it will not create the function. remove all from function.

3. If your SP has no return type then you may can use a simple return type value like :
SELECT 1 as DefaultValue  if you already have return type then you don't need that.

4. Select the Store procedure from model browser-> right click -> Add function Import.

5. Check Complex and Click Get column Information

6. Click on Create New Complex type.

7. It will create Function and complex type for that Store Procedure.

Click OK and Build your application.

C# convert a DateTime to an int value

long dtosDateValue = long.Parse(DateTime.Now.ToString("yyyyMMdd")); long dtosTimeValue = long.Parse(DateTime.Now.ToString("HHmmss")); long dtosDateTimeValue = long.Parse(DateTime.Now.ToString("yyyyMMddHHmmss"));