Posts

[SOLVED]Login failed for user ''. (Microsoft SQL Server, Error: 18456)

Image
If you want to try to connect to database using sql authentication and the result is failed due to error code "18456" , here are the solution that you might want to try. I already solved the issue (in my case the problem because of the database did not set to allow sql connection to pass. So the solution is to enable the SQL Server authentication. Enable SQL Server Authentication  Login to the SQL Server using windows authentication. Right click on the SQL Server node >> properties. Go to Security tab. Under SQL Authentication choose SQL Server and Windows Authentication mode. Click Ok Button. Go to Services . Control Panel >> Administrative tools >> Services >> Find SQLServer instance. Restart SQL Server instance. Try to login again using your login information. Done. By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

SQL view error "more column names specified than columns defined"

Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]View or function 'dbo.myviewname' has more column names specified than columns defined. The error occur because of the original table has changed the column. So that the view definition will affected and whenever you perforl select statement the error will occur. Solution Resave the view table and the problem solve. By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

C# - How to open form in full screen

This example shows how to make open windows form full screen of computer. In this example, i will use F11 as a shortcut key to turn form to full screen. Step By Step : Create one windows form project Add Form 2 in the solution. Add method to event Key Up in Form 1 Copy code below in Key Up  event method Form 1 The Code private bool _bFullScreenMode = false; : : : private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { if ( e.KeyData == Keys.F11) { if (_bFullScreenMode == false) { Form2 f = new Form2(); this.Owner = f; this.FormBorderStyle = FormBorderStyle.None; this.Left = (Screen.PrimaryScreen.Bounds.Width/2 - this.Width/2); this.Top = (Screen.PrimaryScreen.Bounds.Height/2 - this.Height/2); f.Show(); _bFullScreenMode = true; f.KeyUp +=new KeyEventHandler(Form1_KeyUp); } else { Form f = this.Owner; this.Owner = null; f.Close(); this.FormBorderStyle = FormBorderStyle.Sizable; ...

Moving text example in C#

Image
This is a example of creating moving text in C#. In order to do the moving text, you just need timer and label controller/component . Steps by Step: Create one windows form project add one label in the form. copy and paste code below. Hit "CTRL + F5" and see what will happen. The code : public partial class Form1 : Form     {         private string[] words = new string[3];         private int i, j;         public Form1()         {             InitializeComponent();         }         private void timer1_Tick(object sender, EventArgs e)         {             if(i.Equals(words[j].Length))             {                               label1.Text = "";       ...

CSV Splitter example in VB.NET

Image
Hye guys, this is a example of CSV Splitter created from VB.NET language. Since i dont have enough time to explained each code, so i just copy the code here and feel free to ask me in the comment. Basically this example will split huge .csv file into several file. So that you can open the csv file faster rather than open the huge one. The Code Imports System.IO Imports System.Text Public Class Form1     Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code "     <STAThread()> _     Public Shared Sub Main()         Application.EnableVisualStyles()         Application.Run(New Form1)     End Sub     Public Sub New()         MyBase.New()         'This call is required by the Windows Form Designer.         InitializeComponent()         'Add any initialization after the InitializeComponent() ...

CSV Splitter example in C#

Image
Hye guys, this is a example of CSV Splitter created from C# language. Since i dont have enough time to explained each code, so i just copy the code here and feel free to ask me in the comment. Basically this example will split huge .csv file into several file. So that you can open the csv file faster rather than open the huge one. The Code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.VisualBasic; using System.Collections; using System.Diagnostics; using System.IO; using System.Threading; namespace CSV_Splitter {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }         public delegate void UpdateProgressSub(int CurrentLine);   ...

What you need to know about Static class

Static Class Properties A static class cannot be instantiated. That means you cannot create an instance of a static class using new operator.  A static class is a sealed class. That means you cannot inherit any class from a static class.  A static class can have static members only. Having non-static member will generate a compiler error. A static class is less resource consuming and faster to compile and execute.  Static Class Example Public static class MyStaticClass  {      Private static int myStaticVariable;      Public static int StaticVariable;      {         Get        {            return myStaticVariable;        }         Set        {            myStaticVariable = value;        }     }    Public stati...