Catatan

Menunjukkan catatan yang berlabel .net

Microsoft Symbol server load when build exe

Imej
Runs into heavy references load when building the .exe debug file. So my solution is.. Firstly I clear all the breakpoint using Ctrl + Shift + F9. Then set the Automatic symbol loading preferences to Load only specified modules. After done all this step then I rebuild my apps and Run as usual. https://stackoverflow.com/q/3377720/10763264  https://stackoverflow.com/a/17651762

C# button_click object sender

Imej
What is object sender, EventArgs e? https://www.codeproject.com/Questions/1068892/What-is-object-sender-EventArgs-e How to call a button click event from another method https://stackoverflow.com/a/14479279/10763264 Sample coding           void btnSBC_Click(object sender, EventArgs e)         {             String stncode = sender.ToString();             stncode = stncode.Substring(stncode.IndexOf(":") + 1);             stncode = stncode.Replace(" ", "");             System.Windows.Forms.Button btn = (System.Windows.Forms.Button)sender;             if(btn.BackColor.ToString() == "GreenYellow")             {                 Form9 f9 = new Form9(connects, "Enabled", stncode);                 f9.ShowDialog();             }             else {                 Form9 f9 = new Form9(connects, "Disabled", stncode);                 f9.ShowDialog();             }         }

C#: Upload excel into database

Imej
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machines Error state as below; Solution: Install Microsoft Access database engine 2010 driver Rujukan :  https://stackoverflow.com/a/6649413/10763264 The given ColumnMapping does not match up with any column in the sources or destination Rujukan :  https://stackoverflow.com/questions/20228359/the-given-columnmapping-does-not-match-up-with-any-column-in-the-source-or-desti

Byte HEX C#

 00,50,00,00,00,00,00,01,00,01, 00,03,01,00,00,00,00,00,00,00, 00,00,00,00,00,01,00,01,02,00, 00,00,00,00,00,00,00,00,00,00, 00,02,00,01,03,00,00,00,00,00, 00,00,00,00,00,00,00,03,00,01, 04,00,00,00,00,00,00,00,00,00, 00,00,00,04,00,01,00,00,00,00, 00,00,00,00,00,00,00,00,d2,18

Test your network connection

Imej
  PowerShell (Windows only) PowerShell  is a scripting tool for Windows. Windows PowerShell comes installed by default in Windows. In the lower-left corner, click the Windows icon and type:  PowerShell At the PowerShell prompt, enter the  Test-NetConnection  command :  Test-NetConnection -ComputerName <address> -Port <port> The Code42 app  uses port 443 and 4287  to connect to authority servers and the Code42 cloud. If you are unsure which port to include, test all. Examples:  Test-NetConnection  - ComputerName central.crashplan.com -Port 443 Test-NetConnection  - ComputerName central.crashplan.com -Port 4287 If the connection passes, a  TcpTestSucceeded: True  message displays similar to the following: ComputerName : central.crashplan.com RemoteAddress : 192.0.2.0 RemotePort : 4287 InterfaceAlias : Ethernet0 2 SourceAddress : 192.0.0.0 TcpTestSucceeded : True If the connection fails, a failure message displays, for example: WARNING: TCP connect to (192.0.

My Socket problems ?

1. Nugget WebSocket# -  https://stackoverflow.com/questions/30523478/connecting-to-websocket-using-c-sharp-i-can-connect-using-javascript-but-c-sha - Library websocket from nugget :   https://www.nuget.org/packages/websocket-sharp.clone/3.0.0 - Install and Use a NuGet Package with Visual Studio -  https://channel9.msdn.com/Series/NuGet-101/Install-and-Use-a-NuGet-Package-with-Visual-Studio-2-of-5 2. Mozilla  Writing WebSocket client applications -  https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications Writing a WebSocket server in C# -  https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_server 3. Sending WebSocket message over C# Socket -  https://stackoverflow.com/questions/13540621/sending-websocket-message-over-c-sharp-socket 4.  5.  6.  Problem from current source code listener 1. C# startIndex cannot be larger than length of string. Parameter name: startIndex -  https://stackoverflow.com/questions/98130

DataMember property ' ' cannot be found on the DataSource

Imej
Error DataMember property ' ' cannot be found on the DataSource at System.Windows.Forms.List BindingHelper.GetList(Object dataSource, String dataMember) at System.Windows.Forms.BindingSource.ResetList() at System.Windows.Forms.BindingSource.System.ComponentModel.ISupportInitialize.EndInit() Solution https://social.msdn.microsoft.com/Forums/windows/en-US/23327a6d-70b5-47c8-9961-581288825550/datamember-property-cannot-be-found-on-the-datasource?forum=winformsdatacontrols

C# Datagridview click specific cell

Imej
 Problem : Solution : How to call Datagridview Cell Click Event in Button_Click private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)  {        if (e.ColumnIndex == 5 || e.ColumnIndex == 6)       {             DoWork(e.RowIndex);        }   }

C# Escaping string character

Escaping string using @ string path = @"C:\Program Files\Microsoft Visual Studio 10.0\"; On mssql escaping character using ESCAPE  WHERE mycolumn LIKE '%\_%' ESCAPE '\' SELECT isTrack.id AS [translated_pf], platformno FROM stationtrack INNER JOIN isTrack ON isTrack.name = stationtrack.track WHERE stationcode = 'KL' AND isTrack.id LIKE '%KL\_%' ESCAPE '\' ORDER BY platformno ASC; References Why does using an Underscore character in a LIKE filter give me all the results - https://stackoverflow.com/a/19588588/10763264 Escaping in C#: characters, strings, string formats, keywords, identifiers -  https://www.codeproject.com/Articles/371232/Escaping-in-Csharp-characters-strings-string-forma

C# OpenFileDialog

  Rujukan : OpenFileDialog In C#

C# Error : Creating Window Handle (Not Solve)

Imej
Try solution 1. Guna  Invoke((MethodInvoker)delegate v this.Invoke((MethodInvoker)delegate {   //call your method here  });  private void ultraButton1_Click(object sender, EventArgs e) {   Task.Factory.StartNew(() => myMethod1());  }  void myMethod1() {   //my logic   this.Invoke((MethodInvoker)delegate {     ultraDesktopAlert1.Show($"my message header", "my message");   }); }  Rujukan : “Error Creating Window Handle” 2. Sebab timer Rujukan :  High ram load and “Error creating window handle” exception 3. Before adding handlers for events , First remove them RemoveHandler objReportViewer.LocalReport.SubreportProcessing, AddressOf SubReportProcessing AddHandler objReportViewer.LocalReport.SubreportProcessing, AddressOf SubReportProcessing Rujukan :  Error creating window handle 4. Kena Dispose Graphic / Pen OK, everyone is focused on the Pen. That's not the problem in the code you posted. Well, there is one small problem where you're not disposing the P

C# Change variable in opened form from another form

 List rujukan delegate Source : Change a variable on a already open form Visual C# -  https://social.msdn.microsoft.com/Forums/windows/en-US/fc734145-5247-4348-867f-1ab636a30871/change-a-variable-on-a-already-open-form-visual-c?forum=winforms Using Delegates to Communication Between Windows Forms -  https://www.c-sharpcorner.com/article/using-delegates-to-communication-between-windows-forms/ C# .NET Delegates and Events - https://www.c-sharpcorner.com/UploadFile/puranindia/C-Sharp-net-delegates-and-events/ More info : Event and Delegate in C# -  https://medium.com/@ibrahimyengue/event-and-delegate-in-c-1b6516002833

C# Timer : Run function in interval time

Apa itu Timer function di dalam .NET C#? ~ ~ ~ Contoh code public Form1() {  InitializeComponent(); timer1 = new Timer();  timer1.Tick += new EventHandler(timer1_Tick);  timer1.Interval = 5000; // in miliseconds timer1.Start(); } Rujukan Execute specified function every X seconds -  https://stackoverflow.com/a/6169305/10763264 C# - how do you stop a timer? -  https://stackoverflow.com/a/4563738/10763264

C# .NET Positioning

Imej
Kat sini, Lee senaraikan kaedah untuk membuat positioning (Location) di C# Windows Form. FlowLayoutPanel  TableLayoutPanel  Location Point() method  // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Controls.Add(this.stationCodeTBB, 0, 1); this.tableLayoutPanel1.Controls.Add(this.pfUp, 0, 0); this.tableLayoutPanel1.Controls.Add(this.pfDown, 0, 2); this.tableLayoutPanel1.Location = new System.Drawing.Point(19, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Fo

How to create .exe extension for deployment

Imej
*Tutorial here Rujukan How to Create Setup.exe Visual Studio 2019 https://www.youtube.com/watch?v=-oIf6lGdaik

How to search a Record in DataTable C#

Contoh coding DataRow[] foundRows = dtvstations.Select("stationname =  'KL' "); conn = foundRows[0]["connstring"].ToString(); Apply method private void CB_vstation_SelectedIndexChanged(object sender, EventArgs e)         {             if(CB_vstation.Text.ToString() != "")             {                 string exp = "stationname = '" + CB_vstation.Text.ToString() + "'";                 MessageBox.Show(exp);                 DataRow[] foundRows = dtvstations.Select(exp);                 conn = foundRows[0]["connstring"].ToString();                 viewByStation(conn);             }         } Rujukan : C# -syntax error: missing operand after 'TAG' operator.

C# The underlying connection was closed (Solved)

Imej
 C# The underlying connection was closed: The server committed a protocol violation. Solutions: you might also try doing an IIS reset. Failed!  - Alhamdulillah... The Solution The real problem is I can't access my FTP after I changed my LAN IP Address. So its not the coding problem.. its just misconfig settings on IIS. Open IIS then right click to the FTP Sites. Click Edit Bindings. Change IP Address for ftp and http.  Rujukan :  https://stackoverflow.com/questions/13769613/why-am-i-getting-the-server-committed-a-protocol-violation-section-responsestat How to set up and manage an FTP server on Windows 10