Programming for Everybody

Code VB.Net SQL query combine two columns that contain different data type and display in ComboBox

 



Imports System.Data.SqlClient

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Dim conn As New SqlConnection("Data Source=.;Initial Catalog=products;integrated Security=true")

        'conn.Open()

        Dim cmd As New SqlCommand("Select id, '(' +  Cast(id As nvarchar(50))+ ')' + item_product  As products from names_products", conn)

        Dim da As New SqlDataAdapter(cmd)

        Dim dt As New DataTable

        da.Fill(dt)

        With ComboBox1

            .DataSource = dt

            .DisplayMember = "products"

            .ValueMember = "id"

            .Text = "Select Product"

        End With

    End Sub

End Class


How to filter subform using Combo box in MS access forms VBA

In this video, we'll show you how to filter a subform using a Combo box in MS access forms VBA. This method is useful if you want to display different data fields in a subform depending on the value of a selected field. We'll use the Combo box example to illustrate how to filter a subform using VBA. After watching this video, you'll be able to filter a subform using a Combo box in MS access forms VBA with ease! Subscribe to @programmingforeverybody https://www.youtube.com/@programmingforeverybody/?sub_confirmation=1

Excel VBA tutorial for beginners- How to create login form in Microsoft Excel VBA 2023



In this video, we'll learn how to create a login form in Microsoft Excel using VBA. We'll show you how to create a user login form with a show and hide password textbox. This tutorial is useful if you need to create a login form for your website or application. If you're a Microsoft Excel user, then this video is for you! In this video, we'll show you how to create a user login form using VBA. We'll show you how to create a user login form with a show and hide password textbox. This tutorial is useful if you need to create a login form for your website or application. So make sure to watch the video and learn how to create a login form with 
Subscribe to my channel to find everyday new information in programming and Computerr Science Subscribe to @programmingforeverybody
https://www.youtube.com/@programmingforeverybody/?sub_confirmation=1

C# tutorial: Retrieve data from SQL server based on comboBox Inside dataGridView with code

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.SqlClient; namespace combobox_dataGridView { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void Form2_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=students;Integrated Security=True"); SqlCommand cmd = new SqlCommand("Select code_student From marks_students", conn); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); code_student.DataSource = dt; code_student.DisplayMember = "code_student"; code_student.ValueMember = "code_student"; } private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=students;Integrated Security=True"); for (int i = 0; i <=dataGridView1.Rows.Count - 1; i++) { SqlCommand cmd = new SqlCommand("Select id,firstname,lastname,grade,marks From marks_students Where code_student = '" + dataGridView1.Rows[i].Cells[0].Value + "'", conn); conn.Open(); SqlDataReader myreader = cmd.ExecuteReader(); if (myreader.Read()) { dataGridView1.Rows[i].Cells[1].Value = myreader["id"].ToString(); dataGridView1.Rows[i].Cells[2].Value = myreader["firstname"].ToString(); dataGridView1.Rows[i].Cells[3].Value = myreader["lastname"].ToString(); dataGridView1.Rows[i].Cells[4].Value = myreader["grade"].ToString(); dataGridView1.Rows[i].Cells[5].Value = myreader["marks"].ToString(); } conn.Close(); } } private void dataGridView1_CurrentCellDirtyStateChanged(object sender, EventArgs e) { if (dataGridView1.IsCurrentCellDirty) { dataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit); } } } }

How to create login form in Microsoft Access VBA 2023

 


In this video, we're going to show you how to create a login form in Microsoft Access 2016. This is a useful skill if you need to create a login form for a database or if you're developing a custom application. If you're looking to learn how to create a login form in Microsoft Access 2023, then this video is for you! We'll walk you through the steps necessary to create a login form in Access 2016, and provide some helpful tips along the way. Watch and learn! Subscribe to @programmingforeverybody https://www.youtube.com/@programmingforeverybody/?sub_confirmation=1