Posts

Showing posts from September, 2025

Understanding the Pillars of OOP in VB.NET

What is OOP? (Object-Oriented Programming) Object-Oriented Programming (OOP) is a programming paradigm based on the concept of “objects”, which can contain data, in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods). Simple Explanation OOP is a way of writing programs by creating objects that represent real-world things. Each object has: Data: Information about the object (like color, size, name i.e. Property). Behavior: Things the object can do (like move, start, stop i.e. Method/Function). Example to Imagine If you want to make a program about dogs: You create a Dog object. It has data like name, age, and breed. It can do actions like bark(), run(), or eat(). Example ' Define the Dog class (blueprint) Public Class Dog     ' Properties (data)     Public Name As String     Public Age As Integer     ' Method (behavior)     Public Sub Bark()       ...

Understanding Data Types in VB.NET: A Beginner’s Guide

Image
When you're starting your programming journey in VB.NET, one of the first concepts you need to grasp is data types. They are the building blocks that tell the computer what kind of data you want to work with. This guide will help you understand what data types are, why they matter, and how to use them effectively in your VB.NET programs. What Are Data Types? A data type defines the kind of data a variable can store. Think of it like labeling a box: you decide whether the box holds books, clothes, or toys. Similarly, in programming, the data type tells your program if a variable will hold numbers, text, dates, or logical values like True or False. Why is Data Type Important When Declaring Variables? 1. Defines What Kind of Data Can Be Stored The data type tells the computer what kind of data a variable will hold — such as numbers, text, dates, or true/false. For example: Integer stores whole numbers positive/Negative (1, 2, 100, -1,-2,-100). String stores text ("Hello"). B...

VB.NET Class Library Project | Create & Use DLL in Visual Studio (Beginner Friendly)

Image
  What is a Class Library in VB.NET? A Class Library in VB.NET is a collection of reusable classes, functions, and methods that are compiled into a DLL (Dynamic Link Library). This library can then be referenced and used in other projects, such as Windows Forms, WPF, Console Applications, or even Web APIs. Class libraries are especially useful when you want to separate logic, improve modularity, and reuse code across multiple applications. Advantages of Using a Class Library  1. Code Reusability Write once, use anywhere. A class library allows you to centralize common logic like math functions, validations, or API integrations. 2. Modularity  Break down your application into logical units. This makes your code easier to maintain and scale. 3. Separation of Concerns Keeps your business logic separate from UI or presentation code. This leads to cleaner, layered architecture. 4. Easier Testing  Libraries can be independently tested using Unit Test Pr...

Creating a Splash Screen in VB.NET Windows Forms: A Beginner-Friendly Guide

Image
  A splash screen is a brief introductory screen that appears when you launch an application. It typically shows branding elements like a logo, app name, version, or a loading bar. In this guide, you'll learn how to create a splash screen in VB.NET using Windows Forms. Why Use a Splash Screen? Here are a few reasons:  Enhances User Experience  Shows application is loading (especially if startup takes time)  Displays branding and professionalism  Performs background tasks before the main form opens Requirements: Visual Studio (any edition supporting VB.NET) .NET Framework or .NET Core Basic understanding of WinForms Step-by-Step Guide Step 1: Create Two Forms SplashScreen.vb : The splash screen form Form1.vb : The form you want to open after splash screen  Step 2: Design the SplashScreen Add the following controls: Label : App name or version or company name ProgressBar : Shows loading progress Timer : Drives the loading a...

Login Form in VB.NET Using Stored Procedure | VB.NET

Image
  Learn how to create a secure and functional Login Form in VB.NET using a Stored Procedure .  This step-by-step tutorial shows you how to: 1.  Login form design 2. Create Database and table  CREATE TABLE [dbo].[UserMst] (     [Id]       INT           IDENTITY (1, 1) NOT NULL,     [Username] NVARCHAR (50) NOT NULL,     [Password] NVARCHAR (50) NOT NULL,     PRIMARY KEY CLUSTERED ([Id] ASC) ); 3. Create SP (Store Procedure) for login CREATE PROCEDURE [dbo].[sp_login] @un nvarchar(50), @pwd nvarchar(50) AS BEGIN set nocount on select * from UserMst where Username=@un and Password=@pwd END 4. Test SP         exec sp_login @un=Admin,@pwd=pass          exec keyword than SP name than pass parameter 5. Add "Microsoft.Data.SqlClient" NuGet package and Imports Microsoft.Data.SqlClient I have already added 6. Write logic for login...

Creating an executable installer (.exe) in Visual Studio

Image
Creating an executable installer (.exe) in Visual Studio allows you to package your application for easy distribution and installation on other computers. This is typically achieved by using a "Setup Project." Here's a comprehensive guide on how to create a setup `.exe` in recent versions of Visual Studio. Create installable exe file from windows form application in visual studio using setup project 1. Open your Windows Forms application project in Visual Studio. 2. Make sure your project builds successfully by clicking on "Build" in the top menu and selecting "Build Solution" (or pressing Ctrl+Shift+B). 3. Right-click on the solution in the Solution Explorer, select "Add" > "New Project" or go to "File" > "Add" > "New Project". 4. In the "Add New Project" dialog, select "Setup Project" under the "Other Project Types" > "Setup and Deployment" category....

Dev tunnels

Image
             Dev tunnels allow you to securely expose local web services to the internet, creating a public URL that tunnels traffic directly to your development machine. This is useful for testing, collaboration, and integration with external services Uses of dev tunnel in daily development Debugging and testing on different devices Dev tunnels eliminate the need for complex network configurations when you need to test your application on a separate device. You can access your local server from a mobile phone, tablet, or another computer by simply navigating to the tunnel's public URL.  Integrating with external services and webhook  Many third-party services, like payment gateways, social media APIs, and communication platforms (e.g., Twilio), rely on webhooks to send real-time notifications to your application.  Since webhooks cannot send requests to localhost, you need a public URL to receive them.   A dev tunnel provides a secu...

Create installable exe file from windows form application in visual studio

Image
  To create an installable .exe file from a Windows Forms application in Visual Studio, you can follow these steps: 1. **Open Your Project**: Open your Windows Forms application project in Visual Studio. 2. **Build Your Project**: Make sure your project builds successfully. You can do this by clicking on        "Build" in the top menu and then selecting "Build Solution"      (or pressing Ctrl+Shift+B). 3. Right-click on your project in the Solution Explorer and select "Properties" (Optional Step)    - This will open the project properties window.    - In the properties window, go to the "Publish" tab.    - Configure the publish settings as needed (e.g., specify the installation folder, prerequisites, etc.).    - Can directly click on "Publish Now" to publish the application with default settings. or you can         click   on "Publish Wizard" to customize the publishing pro...

Run cs file without main method using NET 10

Image
Run cs file without main method using .NET 10 You don't have to explicitly include a main method in a console application project. Instead, you can use the  top-level statements  feature to minimize the code you have to write. Top-level statements allow you to write executable code directly at the root of a file, eliminating the need for wrapping your code in a class or method. This means you can create programs without the ceremony of a Programm  class and a Main method. In this case, the compiler generates a Program  class with an entry point method for the application. The name of the generated method isn't Main  it's an implementation detail that your code can't reference directly. 1. create ".cs" file, lets create "app.cs" 2. Open folder path in any terminal 3. Run the file using command "dotnet run aap.cs" Note : Prerequisite .NET 10  Example statements 1. Console.WriteLine("Hello World!");  output : Hello World! 2.  int a...

RDLC report in VB.Net windows form application

Image
                                               RDLC report in VB.Net windows form application Dim con As New SqlConnection("Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Employeedb.mdf;Integrated Security=True") Dim SqlQuery As String = "select * from EmployeeMst order by id" Dim cmd As New SqlCommand(SqlQuery, con) Dim da As New SqlDataAdapter(cmd) Dim ds As New DataSet() da.Fill(ds) Dim rds As New ReportDataSource("DataSet1", ds.Tables(0)) ReportViewer1.Reset() ReportViewer1.ProcessingMode = ProcessingMode.Local ReportViewer1.LocalReport.ReportPath = "FirstReport.rdlc"                     'RDLC path ReportViewer1.LocalReport.DataSources.Clear() ReportViewer1.LocalReport.DataSources.Add(rds) ReportViewer1.RefreshReport()