How can I commit user input to the database using VB express edition?

How are you all?

I am new at programming and currently learning visual basic using visual studio express edition. I have three questions:

  • What is the difference between Visual basic express and Visual basic express orcas.
  • Am I justified to uninstall Visual basic express and install Visual basic express orcas
  • There is a database project that I am currently working on using VB express edition. However when I try to commit user input to the local database (Sql server express edition), the changes are only tempolarily held by the dataset. I have cosulted the starter kits available but that same code does not update the database. What could I be doing wrong? Please help me.
  • Below is what I tried to do.

Regards,

Richard

Code Snippet

PublicClass IncomingRefundsForm

'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'Private fields to hold info entered by user into form:

Private m_IRRSerialNumberAsString

Private m_IRRIncomingDateAsDate = #8/13/2002 12:14:00 PM#

Private m_IRRReceivedInFromAsString

Private m_IRRReceivedInByAsString

Private m_IRRTaxHeadAsString

Private m_IRRTaxPayerNameAsString

Private m_IRRTaxPayerIndividualYESNOAsBoolean

Private m_IRRTaxPayerTaxIdentificationNumberAsString

Private m_IRRTaxPayerValueAddedTaxNumberAsString

Private m_IRRAmountClaimedAsDouble

'''

''' Public properties for accessing the info entered by user into form:

'''

PublicReadOnlyProperty IRRSerialNumber()AsString

Get

ReturnMe.m_IRRSerialNumber

EndGet

EndProperty

PublicReadOnlyProperty IRRIncomingDate()AsDate

Get

ReturnMe.m_IRRIncomingDate

EndGet

EndProperty

PublicReadOnlyProperty IRRReceivedInFrom()AsString

Get

ReturnMe.m_IRRReceivedInFrom

EndGet

EndProperty

PublicReadOnlyProperty IRRReceivedInBy()AsString

Get

ReturnMe.m_IRRReceivedInBy

EndGet

EndProperty

PublicReadOnlyProperty IRRTaxHead()AsString

Get

ReturnMe.m_IRRTaxHead

EndGet

EndProperty

PublicReadOnlyProperty IRRTaxPayerName()AsString

Get

ReturnMe.m_IRRTaxPayerName

EndGet

EndProperty

PublicReadOnlyProperty IRRTaxPayerIndividualYESNO()AsString

Get

ReturnMe.m_IRRTaxPayerIndividualYESNO

EndGet

EndProperty

PublicReadOnlyProperty IRRTaxPayerTaxIdentificationNumber()AsString

Get

ReturnMe.m_IRRTaxPayerTaxIdentificationNumber

EndGet

EndProperty

PublicReadOnlyProperty IRRTaxPayerValueAddedTaxNumber()AsString

Get

ReturnMe.m_IRRTaxPayerValueAddedTaxNumber

EndGet

EndProperty

PublicReadOnlyProperty IRRAmountClaimed()AsString

Get

ReturnMe.m_IRRAmountClaimed

EndGet

EndProperty

'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

PrivateSub IncomingRefundRegisterationTableBindingNavigatorSaveItem_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles IncomingRefundRegisterationTableBindingNavigatorSaveItem.Click

Me.Validate()

Me.IncomingRefundRegisterationTableBindingSource.EndEdit()

Me.IncomingRefundRegisterationTableTableAdapter.Update(Me.TaxRefundMonitorDataSet.IncomingRefundRegisterationTable)

Dim IRRSerialNumberAsString

Dim IRRIncomingDateAsDate = #8/13/2002 12:14:00 PM#

Dim IRRReceivedInFromAsString

Dim IRRReceivedInByAsString

Dim IRRTaxHeadAsString

Dim IRRTaxPayerNameAsString

Dim IRRTaxPayerIndividualYESNOAsBoolean

Dim IRRTaxPayerTaxIdentificationNumberAsString

Dim IRRTaxPayerValueAddedTaxNumberAsString

Dim IRRAmountClaimedAsDouble

IRRSerialNumber =Me.IRRSerialNumber

IRRIncomingDate =Me.IRRIncomingDate

IRRReceivedInFrom =Me.IRRReceivedInFrom

IRRReceivedInBy =Me.IRRReceivedInBy

IRRTaxHead =Me.IRRTaxHead

IRRTaxPayerName =Me.IRRTaxPayerName

IRRTaxPayerIndividualYESNO =Me.IRRTaxPayerIndividualYESNO

IRRTaxPayerTaxIdentificationNumber =Me.IRRTaxPayerTaxIdentificationNumber

IRRTaxPayerValueAddedTaxNumber =Me.IRRTaxPayerValueAddedTaxNumber

IRRAmountClaimed =Me.IRRAmountClaimed

Me.IncomingRefundRegisterationTableTableAdapter.Insert(IRRSerialNumber, IRRIncomingDate, IRRReceivedInFrom, IRRReceivedInBy, IRRTaxHead, IRRTaxPayerName, IRRTaxPayerIndividualYESNO, IRRTaxPayerTaxIdentificationNumber, IRRTaxPayerValueAddedTaxNumber, IRRAmountClaimed)

Me.IncomingRefundRegisterationTableTableAdapter.Fill(Me.TaxRefundMonitorDataSet.IncomingRefundRegisterationTable)

Try

Me.Validate()

Me.IncomingRefundRegisterationTableBindingSource.EndEdit()

Me.IncomingRefundRegisterationTableTableAdapter.Update(Me.TaxRefundMonitorDataSet.IncomingRefundRegisterationTable)

MsgBox("Update successful")

Catch exAs Exception

MsgBox("Update failed")

EndTry

EndSub

PrivateSub IncomingRefundsForm_Load(ByVal senderAs System.Object,ByVal eAs System.EventArgs)HandlesMyBase.Load

Me.IncomingRefundRegisterationTableTableAdapter.Fill(Me.TaxRefundMonitorDataSet.IncomingRefundRegisterationTable)

EndSub

PrivateSub BindingNavigatorAddNewItem_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles BindingNavigatorAddNewItem.Click

EndSub

EndClass

[20056 byte] By [RichardSharp] at [2008-2-24]
# 1

Hi Richard,

I had a similar problem with a data app i'm working on. I found that when I tested the code, my database wouldn't take the changes. I was going nuts! I searched through lines of code to see where i went wrong, but I couldn't find anything....

I bit the bullet and published my app to a remote server then installed it and guess what?! The data was saved to the database without a problem.

I may be doing things wrong but hey if aint broke don't fix it! Try and publish a test app and see what happens.

Cheers

OzNick

OzNick at 2007-9-25 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...
# 2

Thanks OzNick

It worked just right. God bless.

Richard.

RichardSharp at 2007-9-25 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...
# 3

Richard,

Glad you got your data issue sorted. In answer to your first two questions, VB Express Orcas is a preview version of the next VB Express release (VB version 9), so it isn't the finished article and still has (some) bugs in it. It's been released as a Community Technology Preview (CTP), so that geeks like me can try it out and report any bugs.

You're more than welcome to install Orcas if you wish, but any projects you create using Orcas won't work in your older version of VB Express (VB version 8), so if you do come across any bugs that you can't work around, you won't be able to load your project into VB version 8 to continue.

In short, it's up to you - do you wan to use the official, "stable" version of VB Express, or do you want to be that little bit ahead of the pack and use a pre-release version?

Hope that helps :-)

Phil

PhilW0503 at 2007-9-25 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...
# 4

Thank you Phil.

With guys like you around, I will soon be a superb programmer.

Richard

RichardSharp at 2007-9-25 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...
# 5

I suspect that your SQL Express implementation is such that you are copying the database to the executable directory (bin) when you build. In that case, each time you build, you are overwriting the database. Thus you are updating the value in the bin database. Then when you close the solution and look at the database you may be looking at another copy of the database. This is particularly true when you are working on web applications where you put the database in the app_data folder.

Jim Wooley

http://devauthority.com/blogs/jwooley

jwooley at 2007-9-25 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...

Visual Studio Orcas

Site Classified