User Profile

Collapse

Profile Sidebar

Collapse
AlexW
AlexW
Last Activity: Oct 31 '07, 10:15 PM
Joined: Sep 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • SQL syntax for Inserting Multiple Rows Under Jet 4.0 using OLEDB

    Hi

    I have been scouring the web for some information regarding how to insert multiple rows at once using an SQL string. I am using an OLEDB dataadapter to communicate with an MS Access DB


    The code below works:
    Code:
      
    myDataAdapter.InsertCommand = New OleDbCommand("INSERT INTO Inventory ( PartNum ) SELECT 'blah' AS PartNum FROM [Temp]
    myDataAdapter.Update(gbldataset, "Inventory")
    ...
    See more | Go to post

  • Ok, but I still can't get the database to update. The code for my commit changes to database function is shown below. The problem arises when I start trying to update the database with the inserted rows (towards the end). You can see I've tried lots of different approaches (commented out) but am still getting nowhere.... still get message saying "syntax error in INSERT INTO" statement when I try and update the database. Can anyone help???...
    See more | Go to post

    Leave a comment:


  • Do I Have to make a really long SQL string to update multiple records at once eg?

    INSERT INTO tablename (blah) VALUES ('asdf'); INSERT INTO tablename (blah) VALUES ('asdf'); INSERT INTO tablename (blah) VALUES ('asdf'); INSERT INTO tablename (blah) VALUES ('asdf');

    Can somebody tell me if there is a more elegant solution?
    See more | Go to post

    Leave a comment:


  • Trying to update a database with the contents of a dataset

    Hi

    I have a dataset which contains the entire contents of a database. During the course of my program some records are added. I am having difficulty trying to find an SQL command that will transfer the added rows in one go (without using a tableadapter which I'm told I can't define programmaticall y).

    What is the quickest way to add all the added records at once? (can I even do this?) do I have to define an enumerator...
    See more | Go to post

  • AlexW
    replied to Dataview rowfilter problem
    Problem solved

    http://www.thescripts. com/forum/showthread.php? p=2893824#post2 893824
    See more | Go to post

    Leave a comment:


  • AlexW
    replied to VB.net Dataview Rowfilter behaviour problems
    in .NET
    Problem solved

    I had to either create a binding source and call the .endedit() method on it or change the selected row.

    I chose the former. My revised working code to add a new datarow to the dataset is shown below:

    Code:
    Private Function fillDataRowfromForm() As System.Data.DataRowView
    
            Dim myBindingSource As BindingSource = New BindingSource
            myBindingSource.DataSource =
    ...
    See more | Go to post

    Leave a comment:


  • AlexW
    replied to VB.net Dataview Rowfilter behaviour problems
    in .NET
    I just noticed that the .haschanges property of the dataset that my dataview refers to remains false after adding a row. Could this have something with it?

    The code for adding a new datarow is shown below... am I missing a step?

    Code:
            
            Dim addedRow As System.Data.DataRowView
            'creating new row in dataview, making addedRow point to it
            addedRow = addPartsDataView.AddNew()
    See more | Go to post

    Leave a comment:


  • AlexW
    replied to VB.net Dataview Rowfilter behaviour problems
    in .NET
    Sorry I don't follow your reasoning, why would I need to update the database I got the original data from with each row I add? Why can't I make my changes to a local dataset and then update all the changes at once?

    what is happening here is that the rowfilter is getting is not filtering out newly added rows. ie the test below should be returning 0 when I give it a partnumber which is unique, but instead returns the number of the rows...
    See more | Go to post

    Leave a comment:


  • AlexW
    started a topic VB.net Dataview Rowfilter behaviour problems
    in .NET

    VB.net Dataview Rowfilter behaviour problems

    Hi

    I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfil ter property.
    Basically what happens is this:

    -a global dataview is created
    -The user enters new part information into a form.
    -A function is called to check to see if the part is a new part (so that two identical part numbers are not added to the database....
    See more | Go to post

  • AlexW
    started a topic Dataview rowfilter problem

    Dataview rowfilter problem

    Hi

    I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfil ter property.
    Basically what happens is this:

    -a global dataview is created
    -The user enters new part information into a form.
    -A function is called to check to see if the part is a new part (so that two identical part numbers are not added to the database....
    See more | Go to post
    Last edited by AlexW; Oct 19 '07, 05:44 PM. Reason: clarity

  • AlexW
    replied to Multiselect in VB.NET 2005
    I found this to be true as well.

    two fixes, either sort your array or listbox by setting its .sorted property to true

    or if this is impossible then make your selection by selecting the last item in the selection and then shift clicking the first item.

    This particular bug actually grabs the last item you clicked on and puts it at the head of the list followed by the rest of the items in alphabetical order...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...