[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I create an SQL query to save changes in my database?

Posted on 2007-11-23
3
Medium Priority
?
261 Views
Last Modified: 2010-04-23
I have a database table called table1 which I have loaded into a visual basic program. When I dragged the icon from the data sources window to the form and created the datagrid, a toolbar was created with a save button on. However, when I click it to save changes, the changes are not actually saved.

I navigated to the properties of my tableadapter and found that the updatecommand box was empty (so I assume the update command does nothing when called in a program).

What would I need to put in a new query to save changes to my database? It only has 2 columns: Episode and Rating.

Thanks
0
Comment
Question by:BIGZIPZ1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Expert Comment

by:SQL_SERVER_DBA
ID: 20341518
just add an index to the table, make it a unique key.
0
 

Author Comment

by:BIGZIPZ1
ID: 20341651
But the updatecommand field is empty in the properties. I must have deleted it when I was trying to get it to work. If the field is empty then when I do tableadapter.update it will execute an empty command right?
0
 
LVL 3

Accepted Solution

by:
ScottParker earned 2000 total points
ID: 20341765
You will probably have to start over.

First add a Unique key to your table like suggested by the previous person,
then go back though the steps and you will end up with something like the following in your forms code..

    Private Sub PendingeventsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PendingeventsBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.PendingeventsBindingSource.EndEdit()
        Me.PendingeventsTableAdapter.Update(Me.Sh_galaxy1DataSet.pendingevents)

    End Sub
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question