Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,045 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,623 people online right now. Registration is fast and FREE... Join Now!




SQL Server 2005 Xpress database don't update

 
Reply to this topicStart new topic

SQL Server 2005 Xpress database don't update, basics one....

eMeRiTuS
4 Mar, 2008 - 02:33 AM
Post #1

New D.I.C Head
*

Joined: 4 Mar, 2008
Posts: 23



Thanked: 1 times
My Contributions
hi.. i'm new to VB.Net, so i think this is one stupid question...
but i just can't get over it....
I want my database to view in DataGridView..
this had done by just dragging the the database into the form i created in VB..
i had enable Adding, Editting and Deleting...
and VB automaticly produce this code for me..
CODE
Public Class Form1

    Private Sub CustomerBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.CustomerBindingSource.EndEdit()
        Me.CustomerTableAdapter.Update(Me.CustomerDataSet.Customer)

    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 'CustomerDataSet.Customer' table. You can move, or remove it, as needed.
        Me.CustomerTableAdapter.Fill(Me.CustomerDataSet.Customer)

    End Sub
End Class


i had refer to many example...
this type of code should enable adding, edtting and deleting...
it do...
and I had try to delete, add and edit my database..
and save it after that...
but after i re-run my program..
the data i changed are not there...
i use SQL Server Xpress and VB 2005
what should I do..?
plz help......
thanks

User is offlineProfile CardPM
+Quote Post

Louisda16th
RE: SQL Server 2005 Xpress Database Don't Update
4 Mar, 2008 - 07:10 AM
Post #2

 101010101
Group Icon

Joined: 3 Aug, 2006
Posts: 1,812



Thanked: 1 times
Dream Kudos: 755
My Contributions
Try this:
Go to your solution explorer and select CustomerDataSet.xsd. Right click on the file and select properties. In the properties window, change the Copy To Output Directory property to Do not Copy.
There's no problem with your code. Check the executable file (.exe file) generated by VB. Run it and you'll find that it works perfectly. What happens is when you are running your application through the IDE, it is built everytime and you database is cleaned. That's why nothing seems to get updated.
Hope this helps smile.gif.
User is offlineProfile CardPM
+Quote Post

eMeRiTuS
RE: SQL Server 2005 Xpress Database Don't Update
5 Mar, 2008 - 02:17 AM
Post #3

New D.I.C Head
*

Joined: 4 Mar, 2008
Posts: 23



Thanked: 1 times
My Contributions
i got it work....
how stupid i am... tongue.gif
thanks for the help...
i'll appreciate it..!!!
i love this..... smile.gif
User is offlineProfile CardPM
+Quote Post

Louisda16th
RE: SQL Server 2005 Xpress Database Don't Update
5 Mar, 2008 - 04:14 AM
Post #4

 101010101
Group Icon

Joined: 3 Aug, 2006
Posts: 1,812



Thanked: 1 times
Dream Kudos: 755
My Contributions
Sure no problem smile.gif. Now go tell your friends smile.gif.
User is offlineProfile CardPM
+Quote Post

eMeRiTuS
RE: SQL Server 2005 Xpress Database Don't Update
5 Mar, 2008 - 04:21 PM
Post #5

New D.I.C Head
*

Joined: 4 Mar, 2008
Posts: 23



Thanked: 1 times
My Contributions
no problem... biggrin.gif
i'll spread the word...

i here just wanna ask...
when we open the .exe file that VB created...
and modifiy the data there..
and then I open my database using SQL..
it is no change there after all...
are this normal..?
or the modified data actually store at the different place...?
thanks...
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:00PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month