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

x
?
Solved

Binding Navigator Not Working

Posted on 2010-11-25
8
Medium Priority
?
1,214 Views
Last Modified: 2012-05-10
vb.net 2008
sql server express 2005 sp3

Did I miss something.
I just created a Data Source to my sql server express table
Created a form.
Dragged my datasource node code to the form.
The dataset and binding navigator toolbar  was created.

But the records are not deleting or adding to the sql server database ?
The only code I see behind the buttons is the save button. code ???

Did I miss a step somewhere...
I thought the code to saving a record , saving, was added automatically during design mode.


Thannks
fordraiders


 
0
Comment
Question by:fordraiders
[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
  • 2
  • 2
  • +1
8 Comments
 
LVL 11

Expert Comment

by:Deepak Lakkad
ID: 34215716
Hi,

Probably following code will be there on you Code Behind file

    Private Sub BindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorSaveItem.Click
        Me.Validate()
        Me.BindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DataSet)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'IGMS_MasterDataSet.IGMS_Company' table. You can move, or remove it, as needed.
        Me.TableAdapter.Fill(Me.DataSet.IGMS_Company)
    End Sub

Open in new window


If yes, you are not missing anything, but do you press Save button after Deleting Record?

If you don't click on Save after Deleting record, it will not delete record.

- Deepak Lakkad
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 34216479
To save, add and update data from local datasource to database need to code. The controls only update/add/delete data from local source (dataset, datatable).
0
 
LVL 3

Author Comment

by:fordraiders
ID: 34217350
Patel,
OK.Where are examples of this to finish it out..from locasource to database ?
 Thanks
fordraiders
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34218480
Add a messagebox and load which shows the Update and Delete commands of the adapter.

msgbox(tableadaptername.UpdateCommand.CommandText)

Do you have a primary key in the Select statement or the column list?
0
 
LVL 3

Author Comment

by:fordraiders
ID: 34219459
CodeCruiser, Thanks for replying.
I have a primary key..., I guess I was assuming it worked the same as MsAccess... It writes directly to the data table and saves....it sounds as if this is is what it is doing in sql server express.?

I added this ?:
' for adding a new record..
 Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        TblMainDataBindingSource.AddNew()
    End Sub

So would I use the bindingsource.. to do all the saving into sql express table.. ?

Thanks
fordraiders
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34219505
I think you would use tableadaptor.updateall() function.
0
 
LVL 11

Accepted Solution

by:
Deepak Lakkad earned 2000 total points
ID: 34220729

Hi

Pls. check value of "Copy to Output Directory" property of your Database.

It may be "Copy if New".

This will copy your database into "bin" folder every time you run the project.

When you delete records, it will be delete from database which is in "bin" directory.

Again, when you run the project, it will copy old database in which data is not changed.

Check it out


- Deepak Lakkad
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 34234442
That was it Thanks !
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 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