Coalesce is not working and Update is no updating

My code worked a few weeks ago and has since stop working, reasons are totally not clear to me as to what happended.

However, I need to get this thing up and running.  It will not longer Coalesce data entry. Iran the debugger and the correct values are in the specified objects as if it is the first time I run the page for a person it will input data, but not of subsequent data entry attempts.

My code: ( I trully appreciate your help)

Ayo

'Using "With/End With" pass content to columns from text objects and datatime variables (see above)

With cmdCommentUpdate

.Parameters.Add(New SqlClient.SqlParameter("@UserID", ddlEmployeeSuperCmt.SelectedValue))

.Parameters.Add(New SqlClient.SqlParameter("@Today", bDate))

.Parameters.Add(New SqlClient.SqlParameter("@Comments", dtToday & " " & UCase(userNamedbInsert) & " " & txtComment.Text & " " & vbCrLf))

.Parameters.Add(New SqlClient.SqlParameter("@CommenterLogon", UCase(userNamedbInsert)))

.Parameters.Add(New SqlClient.SqlParameter("@CommentDate", dtNow))

'Establish the type of commandy object

.CommandType = CommandType.Text

'Pass the Update nonquery statement to the commandText object previously instantiated

.CommandText = "UPDATE ATTTble" & _

" SET Comments = COALESCE(Comments, '') + @Comments, CommenterLogon = @CommenterLogon, CommentDate = @CommentDate" & _

" WHERE (UserID = @UserID) AND (Today = '" & lblDate.Text & "') "

End With

0
Ayomide
11/21/2007 4:28:47 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

5 Replies
728 Views

Similar Articles

[PageSpeed] 39

Looking at your code if there is an existing comment field for the record the comment field will never get updated.  You might want to try,

 

set Comments = coalesce(@comments, comments)
 

This will first see if the value passed in is null, if so it just keeps the existing value otherwise it updates.

Let me know if this helps, or if i am not understanding your question.

0
kyle
11/21/2007 5:48:48 PM

set Comments = coalesce(@comments, comments)

 The code continues to over write what is in the database instead of appending the comments.

 Ayo

 

0
Ayomide
11/21/2007 6:41:50 PM

Possibly a date conversion problem:

With cmdCommentUpdate

.Parameters.Add(New SqlClient.SqlParameter("@UserID", ddlEmployeeSuperCmt.SelectedValue))

.Parameters.Add(New SqlClient.SqlParameter("@Today", bDate))

.Parameters.Add(New SqlClient.SqlParameter("@Comments", dtToday & " " & UCase(userNamedbInsert) & " " & txtComment.Text & " " & vbCrLf))

.Parameters.Add(New SqlClient.SqlParameter("@CommenterLogon", UCase(userNamedbInsert)))

.Parameters.Add(New SqlClient.SqlParameter("@CommentDate", dtNow))

.Parameters.Add("@Today",SqlDbType.DateTime).Value=lblToday.Text

'Establish the type of commandy object

.CommandType = CommandType.Text

'Pass the Update nonquery statement to the commandText object previously instantiated

.CommandText = "UPDATE ATTTble" & _

" SET Comments = COALESCE(Comments, '') + @Comments, CommenterLogon = @CommenterLogon, CommentDate = @CommentDate" & _

" WHERE (UserID = @UserID) AND (Today = @Today) "

End With

0
Motley
11/21/2007 7:02:01 PM

If that does not work, then you can try (Although, this should have absolutely no effect):

SET Comments = ISNULL(Comments,'') + @Comments

 

0
Motley
11/21/2007 7:06:28 PM

 

For some strange reason, unknown to me,  the oroginal code started working.

 

Thanks for all your suggestions.

Ayomide

0
Ayomide
11/21/2007 7:24:51 PM
Reply:

Similar Artilces:

updates, updates, updates
Name: hans jensen Email: hansjensen44_athotmaildotcom Product: Firefox Summary: updates, updates, updates Comments: why is it everytime i go online firefox has new updates, 3 -4 times every day, its never ending..........whats all the problems??? please email me and let me know, ty,.........Hans Jensen Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 ...

Updates Updates Updates
I was a big fan of Firefox.. Now, I don't even like to use it. Seems like every time I start it up I have to update some addin OR the browser itself. And unfortunately the update nag messages are always presented when I start a browsing session. I find this annoying because, typically, when I open a web browser all I want to do is go to a web page. Not update the browser. I can agree that staying current with the latest version could give the best, fastest, safest web experience. But that point becomes mute when I start off every other browsing session with a new update. And mos...

updates, updates, updates, NO MORE!
Name: Andreas Email: unbekanntatjokerdotms Product: Firefox Summary: updates, updates, updates, NO MORE! Comments: Hi ! if you want to develop a fine webbrowser, maybe you nee a new management. To release a new buggy version every two weeks is not very professional. Test your software before the release and let the user download a stable browser. this update-orgy since 2.0.0 used me to use Opera instead of FF. We haved use FF in our Company, but we can't deploy a new version every week to +200 Windows-clients, so in our company we've decided to return to IE, ...

Updates, updates and more updates
Name: pirhan Email: pirhan_chanathotmaildotcom Product: Firefox Summary: Updates, updates and more updates Comments: Hello, Normally I use Safari, but my iBook is out of commission for a while. So, I am forced to use a PC to which I would much rather use Firefox than Internet Exploder. However, as much I enjoy not using a Microsoft product, and use a product that works decently, I am severely annoyed about the constant updates I am put through. In the last two days, I had to wait for Firefox to install updates before I could browse and now, I'm alerted that there'...

updates, updates, updates
Holy Crap, Batman! You'd think I was running Windows XP and it's patch Tuesday. So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready to try one od the BSD's! vince wrote: > Holy Crap, Batman! You'd think I was running Windows XP and it's patch > Tuesday. > > So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 > and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready > to try one od the BSD's! I take ...

SQL Update not updating
Well, it's probably just doing what it thinks its being told to do. I want to understand what exactly date() does in th following:ALTER PROC [dbo].[sp_AdvanceLink_Update]    @AdvLinkID bigint,    @LinkID bigint = NULL,    @UserID int = NULL,    @WebsiteID int = NULL,    @AdvanceCategoryID bigint = NULL,    @SiteURL nvarchar(400) = NULL,    @SiteTitle char(150) = NULL,    @SiteDescription nvarchar(510) = NULL,    @ReciprocalURL nvarchar(400) = NULL,&n...

sql update not updating
I have a web form that poplulates a ddl form a sql db table, then it querys another table and returns values that are set to the .text property of 4 textboxes based on the selectedItem.text property of the ddl. Everything here is working fine. The textboxes are loaded with the correct info, and the ddl is running smoothly. Now when I press the "Save" button is where things don't go so well. I can edit the text in the 4 textboxes, but the information in those boxes is not saved(updated). The page reloads and the old data is back. What am I doing wrong? below is my code ...

keeps making me download update, but, update doesn't work, makes me download update, update doesn't work..................
Name: donald davis Email: galenachefatyahoodotcom Product: Firefox Summary: keeps making me download update, but, update doesn't work, makes me download update, update doesn't work.................. Comments: That's pretty much the whole deal. An update screen pops up, I update, the update doesn't take and the next time I use firefox mozilla the same thing happens over and over and over. Thanks Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.4 ...

Update Update
Name: John Oswell Email: serviceatwinntecdotcom Product: Firefox Summary: Update Update - endless updates Comments: I think it's great you update the product but I'm starting to think this product is more prone to attack and instability by the number of updates i get inflicted with. Quite honestly on the Windows platform you're going to need to convince me that the Firefox browser is "better" than IE8 - my default browser (ff right now) I'm probably going to revert - endless intrusive updates for Firefox is getting very tiring. At least MS (I'm ...

updates,updates, updates,etc.
Name: Product: Firefox Summary: updates,updates, updates,etc. Comments: I am so fed up with all these gd updates I COULD SCREAM! Why can't you get it right and stay with it for a while. Between you guys and MSFT you drive me nuts. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Updates Updates Updates #3
Name: Product: Firefox Summary: Updates Updates Updates Comments: Seems like every time I open the program there is a wait period while some new arcane update gets installed. I have enjoyed and advocated firefox for a good while, but the update thing is really starting to bug me. Doubtless I could simply change the settings to accept the updates or not notify me or something similar - but I CAN'T BE ASSED. I'd have to consider this for more than 30 seconds and as we've already seen I CAN'T BE ASSED. Please make this less annoying in return for which I promis...

Updates updates updates #2
Name: Product: Firefox Summary: Updates updates updates Comments: I love Firefox, but it seems EVERY day there is some sort of updates to download before it will open. You need to figure out a way Firefox can open when asked to do so and update in the background and apply the updates on the next restart. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide on...

Why does update not update ?
Name: T. Strickland Email: shortsportatsbcglobaldotnet Product: Firefox Summary: Why does update not update ? Comments: I check to see if there are any updates but it says none are available but once in a while a update will just appear and say to update to 2.0.0.4 . could this be some kind of scam trying to gain access to my computer? If this is a good update then why doesn't the update do it automatically when I click on it ? Please Inform Tilmon Strickland Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0...

Update update
Gang... Everything for the forthcoming SSL Certificate Fingerprinting system is finished and ready for pre-release deployment. But today the site has been -- and still is -- unusually busy. And I need to bring the server down briefly to update the master resident "ne.dll" which is where all this code lives. And doing that, boots everyone off, cancels all underway downloads, aborts ShieldsUP! runs, etc. So I want to wait a few hours until things have calmed down, and slowed, down a bit. -- ________________________________________________________________ Steve...

Web resources about - Coalesce is not working and Update is no updating - asp.net.sql-datasource

How they coalesce in the Coalition
At 10 minutes past five on Thursday afternoon you could hear a pin drop in Parliament House's marbled Members' Hall.

Ambitious foreign policy push yet to coalesce
Tony Abbott has made a good start to his first year on the world stage. His task now is to balance his ambitious nature with a view of the national ...

Establishment starts to coalesce behind Romney
Atlanta Journal Constitution Establishment starts to coalesce behind Romney Atlanta Journal Constitution By KASIE HUNT AP WASHINGTON — The ...

Turkey's conservatives coalesce under Erdogan
The AK Party has united social conservatives and presided over a burgeoning economy, but also left the nation divided.

Give Them Time To Coalesce Around Talking Points
Sullivan yesterday noted an odd silence over the torture memos, and I predict that will end now that the new talking points have been released ...

Some unhappy as plans coalesce for Cardinal Gibbons site - Baltimore Sun
A plan to build subsidized housing on the former Cardinal Gibbons School campus in Southwest Baltimore has met with opposition from some neighbors ...

Do Not Track standards do not coalesce
The advertising industry is in a huff over Mozilla’s plans to support "The Cookie Clearinghouse" at the Center for Internet and Society (CIS) ...

Student Art Club coalesces around community projects
Students in Orchard Park High School’s Art Club sat transfixed as the school custodian peeled off the brown paper wrappers from one canvas after ...

Schumer Gives Clinton Early Endorsement as Support Coalesces
Politico Schumer Gives Clinton Early Endorsement as Support Coalesces Businessweek Senator Charles Schumer endorsed Hillary Clinton for the ...

Cybercrime and APT tactics coalesce
Once distinct hackers are becoming harder to tell apart.

Resources last updated: 12/10/2015 1:59:46 PM