473,775 Members | 2,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Growl- frustrating - update function DOESN'T DO ANYTHING

I am feeling frustrated and I am willing to bet its something stupid but I
could really use some help.

I have a class called anEvent. On my web form I have a button which creates
a new anEvent and loads the form data into the new event. It then sends that
event to a class function to try and update the data in the database. When
I hit the button, it appears that nothing happens, no error message, just a
return to the previous state of the controls. I have tried catching errors,
using try - catch to see if something is failing somewhere but have gotten
bascially nowhere. I have tried simplifying the query so much that its
"update tblevents set eventname= @eventname where eventid=@eventi d" and
still nothing happens. Please help if you can. Thanks in advance!!

Class:
Public Class anEvent
Public EventName As String
Public Location As String
Public StartDate As DateTime
Public EndDate As DateTime
Public Address As String
Public City As String
Public State As String
Public Zip As String
Public Phone As String
Public ContactPhone As String
Public ContactName As String
Public ContactEmail As String
Public RoomRate As String
Public ReservationCode As String
Public STatus As Integer
Public DateOpened As DateTime
Public Dateclosed As DateTime
Public Additional As String
Public EventID As Integer
End Class
CodeBehind for button:

Private Sub btnUpdateThisEv ent_Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnUpdateThisEv ent.Click
Dim CurrentEvent As New anEvent
Dim URLString As String
CurrentEvent.Ev entName = txtEventName.Te xt
CurrentEvent.Lo cation = txtLocation.Tex t
CurrentEvent.Ad dress = txtAddress.Text
CurrentEvent.Ci ty = txtCity.Text
CurrentEvent.St ate = txtState.Text
CurrentEvent.Zi p = txtZip.Text
CurrentEvent.Ph one = txtPhone.Text
CurrentEvent.St artDate = txtStartDate.Te xt
CurrentEvent.En dDate = txtEndDate.Text
CurrentEvent.Co ntactName = txtContactName. Text
CurrentEvent.Co ntactPhone = txtContactPhone .Text
CurrentEvent.Co ntactEmail = txtContactEmail .Text
CurrentEvent.Ad ditional = txtAdditional.T ext
CurrentEvent.Ro omRate = txtRoomRate.Tex t
CurrentEvent.Re servationCode = txtReservationC ode.Text
CurrentEvent.ST atus = ddlStatus.Selec tedItem.Value
CurrentEvent.Ev entID = txtEventID.Text
E_VentManager.E ventsDB.UpdateE vent(CurrentEve nt)
End Sub
Code for: E_ventManager.E ventsDB.UpdateE vent:
Public Shared Function UpdateEvent(ByV al CurrentEvent As anEvent) As Boolean

Dim conEvents As New SqlConnection
conEvents.Conne ctionString =
ConfigurationSe ttings.AppSetti ngs("Connection String")
Dim cmdEvents As New SqlCommand
cmdEvents.Comma ndType = CommandType.Sto redProcedure
cmdEvents.Comma ndText = "spUpdateEv ent"
cmdEvents.Conne ction = conEvents
cmdEvents.Param eters.Add("@Eve ntName", CurrentEvent.Ev entName)
cmdEvents.Param eters.Add("@Loc ation", CurrentEvent.Lo cation)
cmdEvents.Param eters.Add("@Sta rtDate", CurrentEvent.St artDate)
cmdEvents.Param eters.Add("@End Date", CurrentEvent.En dDate)
cmdEvents.Param eters.Add("@Add ress", CurrentEvent.Ad dress)
cmdEvents.Param eters.Add("@Cit y", CurrentEvent.Ci ty)
cmdEvents.Param eters.Add("@Sta te", CurrentEvent.St ate)
cmdEvents.Param eters.Add("@Zip ", CurrentEvent.Zi p)
cmdEvents.Param eters.Add("@pHO NE", CurrentEvent.Ph one)
cmdEvents.Param eters.Add("@Con tactName", CurrentEvent.Co ntactName)
cmdEvents.Param eters.Add("@Con tactPhone", CurrentEvent.Co ntactPhone)
cmdEvents.Param eters.Add("@Con tactEmail", CurrentEvent.Co ntactEmail)
cmdEvents.Param eters.Add("@Roo mRate", CurrentEvent.Ro omRate)
cmdEvents.Param eters.Add("@Res ervationCode", CurrentEvent.Re servationCode)
cmdEvents.Param eters.Add("@Add itional", CurrentEvent.Ad ditional)
cmdEvents.Param eters.Add("@Sta tus", CurrentEvent.ST atus)
cmdEvents.Param eters.Add("@Eve ntID", CurrentEvent.Ev entID)
conEvents.Open( )
cmdEvents.Execu teNonQuery()
conEvents.Close ()

End Function
Nov 19 '05 #1
4 1168
oh yes, and the stored procedure:
CREATE PROCEDURE spUpdateEvent
@EventName varchar(50),
@location varchar(50),
@Phone varchar(50),
@StartDate datetime,
@EndDate datetime,
@Address varchar(255),
@City varchar(50),
@State varchar(50),
@Zip varchar(50),
@ContactName varchar(50),
@ContactPhone varchar(50),
@ContactEmail varchar(50),
@RoomRate varchar(50),
@ReservationCod e varchar(50),
@Status integer,
@Additional ntext,
@EventID integer
AS
Begin Transaction
UPDATE tblEvents set EventName = @EventName,
Location = @Location,
Phone = @Phone,
StartDate = @StartDate,
EndDate = @EndDate,
Address = @Address,
City = @City,
State = @State,
Zip = @Zip,
ContactName = @ContactName,
ContactPhone = @ContactPhone,
ContactEmail = @ContactEmail,
RoomRate = @RoomRate,
ReservationCode = @ReservationCod e,
Status = @Status,
Additional = @Additional
Where EventID = @EventID
if @@error <> 0 goto Errorhandler
Commit Transaction
return
Errorhandler:
rollback transaction
return
GO
Nov 19 '05 #2
When u say returned to the previous state of the controls
what do u mean?
Is that all ur code?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3

"Patrick Olurotimi Ige" <na********@hot mail.com> wrote in message
news:O4******** ******@TK2MSFTN GP09.phx.gbl...
When u say returned to the previous state of the controls
what do u mean?
I change the data in the form, I click the button. The data reverts
OOOOOOOOOOOOOOO OOHHHHHHHHHHHHH H
I am such an idiot. I forgot my not is postback and the page is doing the
page load function every time.

Is that all ur code?

Yes and hugs and kisses to you because your post turned my brain on!
Nov 19 '05 #4
Child wrote:
[snip]
cmdEvents.Comma ndType = CommandType.Sto redProcedure
cmdEvents.Comma ndText = "spUpdateEv ent"

[snip]

Just a sidenote: you should not prefix your SqlServer stored procedures
with "sp" as that will cause SqlServer to look first in "master" and only when
nothing is found there, in your own db. The same probably goes for "xp".

Hans Kesting
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1527
by: Player | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello I am teaching myself python, and I have gotten a long way, it's quite a decent language and the syntax is great :) However I am having a few, "problems" shall we say with certain conventions in python.
11
1520
by: John Salerno | last post by:
My general problem with events seems to be that there are so many parts to them, and I'm not sure where they all go or when you use which parts. For example, there's the delegate, the event name, the event handler, then the coding that wires it together. For the most part, I do understand these things, but I get confused when it comes to putting it all together. More specifically, here's some code from a book: ...
71
2870
by: Randy Harris | last post by:
I've recently joined several others in attempt to discourage Steve Santos from advertising his PC Datasheet business on CDMA. Among the hundreds of professional consultants who contribute to CDMA, Steve is the only one that persistently violates the charter prohibition on advertising. I think ignoring Steve's actions threatens the survival and continued success of CDMA. Despite his advertising, foul language and name calling, if a...
10
2560
by: MLH | last post by:
?DCount("!", "qryAOLsNeed2Print") - OR - ?DCount(".", "qryAOLsNeed2Print") Both syntaxes return the correct answer for me. But I'm wondering if one is more suitable than the other for some reason. I'm using A97.
9
2311
by: Mike C# | last post by:
Hi all, Running into a little problem. I wrote a small app on VC++ 7.1 that calls the GetDefaultPrinter() function. Now I have to "downgrade" it to VC++ 6, but every time I compile I get the following error: --------------------Configuration: enumprinters - Win32 Debug-------------------- Compiling... CPrinters.cpp
4
1467
by: Growl | last post by:
Hi, i'm a beginner of C++ and would like some help figuring out some things, any suggestions would be appreciated. I'm trying to search a word in an array and if it's found, the output would just put found and if not, then not found. Here is what i came up with. #include <iostream> #include <string> #include <fstream> using namespace std;
7
2794
by: Mag Gam | last post by:
I have a file similar to this: <Customer xmlns="http://www.localsite.com/ecommerce/2006-v01/ organization"> <ns1:Contract xmlns:ns1="http://www.localsite.com/ecommerce/2006-v01/ portfolio"> <ns1:ContractId> <ns2:Identifier xmlns:ns2="http://www.localsite.com/ecommerce/2006- v01/common">199</ns2:Identifier> </ns1:ContractId>
5
743
by: helPlease | last post by:
By long integer i mean very large number(say of 20 digits).If i store it in a character array then what mechanism shud i follow to multiply two such numbers.Could Booth's algo. be applied.Or if anybody has any suggestions then please tell.
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.