Langsung ke konten utama

Postingan

To Read and Write From Serial Port C#

using System ; using System . IO . Ports ; using System . Windows . Forms ; namespace SerialPortExample { class SerialPortProgram { // Create the serial port with basic settings private SerialPort port = new SerialPort ( "COM1" , 9600 , Parity . None , 8 , StopBits . One ); [ STAThread ] static void Main ( string [] args ) { // Instatiate this class new SerialPortProgram (); } private SerialPortProgram () { Console . WriteLine ( "Incoming Data:" ); // Attach a method to be called when there // is data waiting in the port's buffer port . DataReceived += new SerialDataReceivedEventHandler ( port_DataReceived ); // Begin communications port . Open (); // Enter an application loop to keep this thread alive Application . Run (); } private void port_DataReceived ( object sender , SerialDataR...

String to hexadecimal and back C#

This is code to convert String to Hex and Back using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace hexTester {     public class Program     {         public static void Main(string[] args)         {             string a = "testing";             Console.WriteLine(a);             string hex = ConvertStringToHex(a);             Console.WriteLine(hex);             Console.WriteLine(ConvertHexToString(hex));         }                 public static string ConvertStringToHex(string asciiString)         {             string hex = "";             foreach (char c in as...

AX 2012 Call API

Below code helps you to call the Restful API using basic authentication method of adding Authorization header using HTTP Post method. static void ConsumingRestService(Args _args) { str destinationUrl = 'Json Url here', requestXml, responseXml; System.Net.HttpWebRequest request; System.Net.HttpWebResponse response; CLRObject clrObj; System.Byte[] bytes; System.Text.Encoding utf8; System.IO.Stream requestStream, responseStream; System.IO.StreamReader streamReader; System.Exception ex; System.Net.WebHeaderCollection httpHeader; str byteStr; System.Byte[] byteArray; System.IO.Stream stream; System.IO.Stream dataStream; byteStr = strfmt('%1:%2', "USERNAME", "PASSWORD"); requestXml = " { \"storeId\": 25001, \"terminalId\":\"012\", \"transactionSeque...

Query with aggregate function

Query in SQL = Select  AccountNum, sum(AmountCur), sum(AmountMST) from CustTrans group by AccountNum where CustTrans.AccountNum == 'US-018' ;

SQL JOIN

SQL JOIN

FATAL EXCEPTION PERFORMING AXRDCE TRANSFORMATION STEP. THE REPORT CANNOT BE RENDERED. PLEASE CONTACT YOUR SYSTEM ADMINISTRATOR.

FATAL EXCEPTION PERFORMING AXRDCE TRANSFORMATION STEP. THE REPORT CANNOT BE RENDERED. PLEASE CONTACT YOUR SYSTEM ADMINISTRATOR. Today I came with new issue in AX Report. Few days back my report was working fine. But today it showed me something weird information while opening the report. Fatal exception performing AXRDCE transformation step. The report cannot be rendered. Please contact your system administrator. I was just googled, there is no luck. Finally I figured out the issue. First this SSRS report was developed with Query Dataset type. Few days before I just deleted one field from my table. but I checked in (Visual Studio) SSRS–> MyReport –> dataset –>fields  still my deleted field is exist in this report dataset. This is the only reason i got this error. I have tried to delete the unavailable field, but there is no option to delete the field from Report dataset. Here is the solution if you have same scenario.  Export the ...

Format Label Tom Jerry (MS Word)

Setelah beberapa lama aku tidak membuat label undangan, tiba-tiba kemarin aku diminta untuk membuat label undangan Wisuda dengan menggunakan label merek Tom & Jerry (TJ). Harusnya sih menjadi tugas sekretaris panitia tapi karena yang bersangkutan ada tugas di luar kantor maka aku yang membereskannya. Mula-mula aku membuat format labelnya dengan cara manual, tapi untung ada pak Mulyadi (staf tata usaha) yang menyarankan aku untuk mengunduh format label yang telah ada di Internet. Mulailah aku browsing di google dan menemukan format label berbagai ukuran dari website Tom & Jerry di alamat berikut  http://tjlabels.com/en/download.html  (yang link ini agak rempong krn pake masukin nomor captcha-captcha-an). Sedangkan kalau yang link ini langsung pilih file ga pake nomor captcha-captcha-an ( http://tjlabels.com/assets/download/ ). Ternyata juga ada banyak berbagai blog yang menyediakan  link download seperti ini, tapi aku mem- posting  artikel ini ...