Der bliver investeret massivt i AI. Teknologien er mere tilgængelig end nogensinde, og ambitionerne er høje. Alligevel oplever mange virksomheder, at resultaterne udebliver.
Use a SqlDataAdapter object to load the data into a DataSet. Make a DataView based on the data you want to display. In this example, the data is in the Contacts table. Set the DataView's AllowDelete, AllowEdit, and AllowNew properties to False. Then bind the DataView to the DataGrid control for display. The DataGrid will automatically prevent the user from deleting, editing, or adding values.
Private Const SELECT_STRING As String = _ "SELECT * FROM Contacts ORDER BY LastName, FirstName" Private Const CONNECT_STRING As String = _ "Data Source=Bender\NETSDK;Initial " & _ "Catalog=Contacts;User Id=sa"
' The DataSet that holds the data. Private m_DataSet As DataSet
' A DataView to allow read-only access the data. Private m_DataView As DataView
' Load the data. Private Sub Form1_Load(ByVal sender As System.Object, ByVal _ e As System.EventArgs) Handles MyBase.Load Dim data_adapter As SqlDataAdapter
' Create the SqlDataAdapter. data_adapter = New SqlDataAdapter(SELECT_STRING, _ CONNECT_STRING)
' Map Table to Contacts. data_adapter.TableMappings.Add("Table", "Contacts")
' Fill the DataSet. m_DataSet = New DataSet() data_adapter.Fill(m_DataSet)
' Make a DataView for the data. m_DataView = New DataView(m_DataSet.Tables("Contacts")) m_DataView.AllowDelete = False m_DataView.AllowEdit = False m_DataView.AllowNew = False
' Bind the DataGrid control to the DataView. dgContacts.DataSource = m_DataView End Sub
nu skal dette ? vist lukkes ikke fordi jeg har kunnet bruge dit svar
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.