Torna al Thread

strsql = "SELECT * FROM Genere" 'piglio tutti i dati dalla tabella Genere Dim datasetsql As New DataSet("Genere") dataadapter = New SqlDataAdapter(strsql, strconn) dataadapter.Fill(datasetsql, "Genere") 'bindingsource bds = New BindingSource() 'creazione del bindingsource bds.DataSource = datasetsql 'associazione del datasource al Dataset bds.DataMember = "Genere" 'bindaggio del bindingsource ad un membro del Dataset datasetsql.Tables(0).Columns(2).ColumnMapping = System.Data.MappingType.Hidden 'l'indice della colonna da hiddare è il 2 DataGridView1.DataSource = bds 'associazione del datagridview al datasource
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5