Posts

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 = "";                 if (j < words.Length - 1)                 {                     j = j + 1;                     label1.Text = words[j];                 }                 else                 {                     j = 0;                 }                 i = 0;             }             label1.Text = words[j].Substring

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() call     End Sub     'Form overrides dispose to clean up the component list.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boole

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);         private bool _IsAbort;         public void SplitCSV(string FilePath,int lineStart, int lineEnd, int LineCount, int MaxOutputFile, Up

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 static void Function()    {    }  }  Note : The static class can directly called out from the other class for example you create class ClassA , and you can directly type in ClassA to call Function method in class MyStaticClass like this. MyStaticClass.Function(); By Mohd Zul

Nullable Types in .Net C#

Image
Since .NET version 2.0, the new feature introduce which is nullable types.  In the basic programming, how do you assign null to the promitive type such as int, long, and bool. Its is impossible. The following code shows how to define an integer as nullable type and checks if the value of the integer is null or not. Example  /// <summary> /// Nullable types /// </summary> public static void TestNullableTypes() { // Syntax to define nullable types int? counter; counter = 100; if (counter != null) { // Assign null to an integer type counter = null; Console.WriteLine("Counter assigned null."); } else { Console.WriteLine("Counter cannot be assigned null."); Console.ReadLine(); } } If you remove the "?" from int? counter, you will see a warning as following: 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