Results 1 to 40 of 104

Thread: Retrieving and Saving Data in Databases

Hybrid View

  1. #1
    Member
    Join Date
    Mar 2010
    Posts
    58

    Re: Retrieving and Saving Data in Databases

    I am having some problems:

    vb Code:
    1. Using connection As New OleDbConnection(myConnectionString)
    2.             Using adapter As New OleDbDataAdapter("SELECT NameFirst, NameLast FROM Employees", _
    3.                                               connection)
    4.                 Dim insert As New OleDbCommand("INSERT INTO Employees (NameFirst, NameLast) VALUES (@NameFirst, @NameLast)", _
    5.                                            connection)
    6.                 adapter.InsertCommand = insert
    7.                 adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
    8.  
    9.                 Dim table As New DataTable
    10.                 adapter.FillSchema(table, SchemaType.Source)
    11.                 Dim row As DataRow = table.NewRow()
    12.  
    13.                 row("NameFirst") = aName(0)
    14.                 row("NameLast") = aName(1)
    15.                 table.Rows.Add(row)
    16.  
    17.                 adapter.Update(table)
    18.             End Using
    19.         End Using

    I am getting an error with this line:
    adapter.Update(table)
    error:
    No value given for one or more required parameters.

  2. #2
    New Member
    Join Date
    Mar 2011
    Posts
    3

    Re: Retrieving and Saving Data in Databases

    Quote Originally Posted by dethredic View Post
    I am having some problems:

    vb Code:
    1. Using connection As New OleDbConnection(myConnectionString)
    2.             Using adapter As New OleDbDataAdapter("SELECT NameFirst, NameLast FROM Employees", _
    3.                                               connection)
    4.                 Dim insert As New OleDbCommand("INSERT INTO Employees (NameFirst, NameLast) VALUES (@NameFirst, @NameLast)", _
    5.                                            connection)
    6.                 adapter.InsertCommand = insert
    7.                 adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
    8.  
    9.                 Dim table As New DataTable
    10.                 adapter.FillSchema(table, SchemaType.Source)
    11.                 Dim row As DataRow = table.NewRow()
    12.  
    13.                 row("NameFirst") = aName(0)
    14.                 row("NameLast") = aName(1)
    15.                 table.Rows.Add(row)
    16.  
    17.                 adapter.Update(table)
    18.             End Using
    19.         End Using

    I am getting an error with this line:
    adapter.Update(table)
    error:
    No value given for one or more required parameters.
    Hi,
    I'm using DotNetNuke CMS and working on some modules using VB.Net. I have a Datagrid "telerik:RadGrid" and I'm trying to add textbox to filter the rows base on the value that is written in the text box:
    I defined the following:
    Dim dv As DataView = New DataView()
    dv.Table = ?

    dv.RowFilter = "Name like '" & TextBox2.Text & "%'"

    RadGrid1.DataSource = dv
    I have a problem in setting the value of the dv.Table=?

    Can you please guide me to the value that should be there
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width