dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problems updating a dataset

  1. #1
    Join Date
    Jul 2006
    Posts
    13

    Problems updating a dataset

    Hi, I am having trouble in updating my dataset, I create a dataset from a select command and display the details to a datagrid. I then goto the next new line in the datagrid and insert some new details then click the insertRow button (code below) and I get the following error message :-

    the exception which is caught states : - "Value cannot be null. Parameter name: dataset"

    I am not up to scratch with datasets, but all examples I can find of updates are where only one line of the dataset is shown at a time in text boxes and then a blank set of textboxes are displayed to add a new row then convert the textboxes.text to the add row command, but I am creating an application to be a front end to a database so none of the columns are known so I cannot create this form of input as the amount of textboxes would never be known.

    Please help

    Many thanks

    John

    Code for updating dataset

    Code:
     Private Sub btnInsertRow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsertRow.Click
            Dim dset As DataSet
            tblName = (cmbInsertData.Text)
            dbConn.openExistingDatabse("Data Source=" & getDBName() & ";Version=3;New=False;Compress=True;")
            dbConn.createSQLCommand()
            Try
                dbConn.updateDataSet(dset, tblName)
            Catch es As Exception
                MessageBox.Show(es.Message)
            End Try
        End Sub
    Code:
    Public Sub updateDataSet(ByVal dset As DataSet, ByVal tableName As String)
            Dim sqlite_dataAdapter As SQLiteDataAdapter = New SQLiteDataAdapter()
            sqlite_commandBuilder = New SQLiteCommandBuilder(sqlite_dataAdapter)
            sqlite_dataAdapter.Update(dset, tableName)
        End Sub

  2. #2
    Join Date
    Jul 2006
    Posts
    13
    Problem now fixed.

Similar Threads

  1. Replies: 1
    Last Post: 01-12-2006, 07:53 PM
  2. Updating A Databas from a Dataset
    By Hunterlmc in forum .NET
    Replies: 3
    Last Post: 07-06-2005, 02:41 PM
  3. Replies: 0
    Last Post: 12-24-2002, 12:12 AM
  4. Replies: 0
    Last Post: 12-13-2001, 04:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center