Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:19:18+00:00 2026-06-17T19:19:18+00:00

Imports System.Data.SqlClient Public Class Form1 Dim cn As SqlConnection Dim ds As DataSet Dim

  • 0

Imports System.Data.SqlClient

Public Class Form1
Dim cn As SqlConnection
Dim ds As DataSet
Dim adapter As SqlDataAdapter
Dim eleveBindingSource As BindingSource
Dim builder As SqlCommandBuilder

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cn = New SqlConnection("Data source=.; initial catalog=tp4_ado; integrated security=sspi")
    ds = New DataSet()
    eleveBindingSource = New BindingSource
    adapter = New SqlDataAdapter("Select * from Eleve", cn)
    adapter.Fill(ds, "Eleve")
    eleveBindingSource.DataSource = ds
    eleveBindingSource.DataMember = "Eleve"
    DataGridView1.DataSource = eleveBindingSource
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    adapter.Update(ds.Tables("Eleve"))
End Sub

End Class

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:19:19+00:00Added an answer on June 17, 2026 at 7:19 pm

    The problem was that I didn’t Initialized UpdateCommand when I made modification to the DataGridView

    So I Must add this code before updating the DataSet :

    builder = New SqlCommandBuilder(adapter)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imports System.Data.SqlClient Public Class Form3 Private cs As New SqlConnection(Data Source=HUSAIN-PC;Initial Catalog=final1;Integrated Security=True) Private
This is my code for connection: Imports System.Data.SqlClient Public Class frm_edit_patient Dim con As
Here is my code: Imports System.Data Imports System.Data.OleDb Public Class frmAdd Dim con As
I have this class that contains vars for db connection; Imports Microsoft.VisualBasic Imports System.Data.SqlClient
Will the following statement cause a memory leak: Imports System.Data.SQLClient Public Function getConnection ()
I have the following code: Imports System.Data Partial Class Students_AddWishes Inherits System.Web.UI.Page Public dt
In my database context class I have: Imports System.Data.Entity Public Class MusicStoreEntities Inherits DbContext
Imports System.Data.SqlClient Module Module1 Sub Main() Dim iCount As Integer = 1 Try Do
Imports System.Data.OleDb Public Class Log Private mConnectionString As String = Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SID=xxx)(SERVER=DEDICATED)));User Id=xxx;Password=xxx; Dim
Please have a look at the code below: Imports System.Data.Common Imports System.Data.SqlClient Imports System.Data.OracleClient

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.