• 0

Saving ((( ONLY 1 ))) Record with OLEDB


Question

  • 0

I can understand not wanting to use an autonumber, for whatever reason, however ALL tables should have an identity field. (almost always!!)

Without the ident, you are going to be running the risk of many issues like this.

I tend to recommend using GUIDs as the ident, becuase if you ever need to deal with replication issues an autonumber field will cause problems.

Sorry, not the answer you wanted, but the answer you need.

2 answers to this question

Recommended Posts

  • 0

Well, i tried update command but it makes recordS changes to ONLY 1 VALUE "Pcont".

as you see in the code, Pcont is increasing, i want to make each (1) record has a value of "Pcont"

Record No Pcont

Record 1 ----> 1

Record 2 ----> 2

Record 3 ----> 3

but when i use this code i found that , Pcont get the number of records and save it to ALL records ( which is filtered by WHERE A='" + Form1.DefInstance.Label8.Text + "'")

so i got this :

Record No Pcont

Record 1 ----> 3

Record 2 ----> 3

Record 3 ----> 3

While ProDR.Read
            PCont += 1
            Dim ProIns As New OleDbCommand
            ProIns.CommandText = "Update DDPro Set B='" + PCont + "'"
            ProIns.Connection = New OleDbConnection(ProConn.ConnectionString)
            ProIns.Connection.Open()
            ProIns.ExecuteNonQuery()
            ProIns.Connection.Close()
End While

in the command ( ProIns.ExecuteNonQuery() ) this returns the no. of rows affected , I want the opposite of this command, i want to return the 1ST affected row ONLY.

if i did it, i will be able to get that result :

Record No Pcont

Record 1 ----> 1

Record 2 ----> 2

Record 3 ----> 3

Any help please ?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Anyway to download these versions without being on the Experimental builds?
    • Nothing is stopping you from continuing with your testing cadence. If updates are released every 2 weeks instead of 4, and you test once every 4 weeks, the exact same amount of patches will still be available for you in those 4 weeks. For example: Before 4th week - patch 1, 2, 3, 4 After 2nd week - patch 1 and 2 4th week - patch 3 and 4 Still the same amount after 4.
    • Everyone else has said it. I'm gonna say it - you don't know what you're talking about. I do. I have two laptops. One work, one personal. I have access to two more laptops - both personal. At home I manually update my personal laptop when I see on Neowin that there is an update - I carry on and only apply the updates when I am ready. My work one only updates when my workplace decides to send it - I carry on and only apply the updates (when they actually arrive, which is usually days after the release) when I switch off the laptop at the end of the day as usual. The two other personal laptops only get updated when I get to it which is rarely - the people who own them carry on using them until I get to it and update them. All of the browsers on all laptops are configured to restore the tabs when launched. Google and Microsoft have changed from 6 weeks to 4, and it looks like it's going to move to 2. None of these changes affect how any of these browsers on the laptops are used. Not one jot. My advice to you is stop panicking whenever you see an update. Just carry on with what you're doing. This even benefits you in a way - from your comment you sound like you don't like the changes or the frivolous new features - great - then carry on as before!
    • AMAZON needs to take total accountability for this.
    • Server Summit had a heap of announcements, ADCS changes are baller.
  • Recent Achievements

    • Week One Done
      Jeroen Wilms earned a badge
      Week One Done
    • Week One Done
      rolfus earned a badge
      Week One Done
    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      509
    2. 2
      +Edouard
      198
    3. 3
      PsYcHoKiLLa
      138
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      80
  • Tell a friend

    Love Neowin? Tell a friend!