Skip to main content
WPF ComboBox SelectionChanged 001

WPF Bind ComboBox using MS SQL database

WPF Bind ComboBox using SQL database. WPF Fill Combo Box using MS SQL Database. Code : String connectionString = “Data Source=192.168.0.192;Initial Catalog=ParallelCodes;User ID=sa;Password=789”; SqlConnection con = new SqlConnection(connectionString); SqlCommand cmd = new SqlCommand(“select * from Producttbl”, con); con.Open(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); adapter.Fill(dt); cbbDays.ItemsSource = dt.DefaultView; cbbDays.DisplayMemberPath = “ProName”; […]

Read More

ASP.NET fill Dropdownlist from MS SQL Server Database

ASP.NET fill Dropdownlist from MS SQL Server Database

ASP.NET  fill Dropdownlist from MS SQL Server Database Script for Database : Create database [SimpleAsp]   Script for Table : USE [SimpleAsp] GO /****** Object: Table [dbo].[tblCities] Script Date: 10/30/2016 19:19:14 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tblCities]( [Id] [int] IDENTITY(1,1) NOT NULL, [Country] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Cities] […]

Read More

Close