Seperate Date and Time Merge; done at SQL Update or C# .NET then Update

I do realize that his could be posted in a few spots but I think the answer is in the SQL.

I have a ASP.NET page, with a SqlDataSource, Text Box and Calendar Controls. I have the textbox and calendar controls eval'ed to the same sql data source DateTime Field. The text box is formatted eval to small time and the calendars eval has no formatting.

ex:

<asp:TextBox ID="START_TIME" Text='<%# Eval("EVENT_START","{0:t}") %>' runat=server Width=200></asp:TextBox>

I want to merge the two controls; one has the date the other has the time when I update the pages data to the SqlDataSource field EVENT_START. I've tried a couple of methods, but I would like some other opinions. As Sql server only supports date and time together I am storing the two together.

I could merge the two together in the code behind on the update button's event handler or merge the two during the update query using parameters.

Not that I could get an illegal date for the calendar control, but I could get garbage from the textfield time. So I still would have to do validation on the text field before the SQL server could do the update.

There's a few ways to go about this, so I was wondering if anyone else has figured out an elegant way to handle it.

wbochar

0
wbochar
2/19/2006 2:31:04 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

1 Replies
1138 Views

Similar Articles

[PageSpeed] 1

I would merge in the ASP.NET application, and pass it a datetime.  But, it's really up to you and how you view the data.  Personally, I would take the stance that the datetime is the event occurance, and dividing the date and time up into separate fields is part of the presentation, hence it's the ASP.NET's job to do this.  You could in another application have a date/time picker that wants the datetime, and presents it as a different control.  Or if you are using XML, you may want it presented as a single field, or perhaps two fields (Or perhaps 6 fields year, month, day, hour, minute, second).
0
Motley
2/19/2006 6:27:42 AM
Reply:

Similar Artilces:

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 ...

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...

How to mannually connect, and perform CRUD (Create,retrieve, insert, update, delete), SQL Server, and VS.NET C#
I am a beginner, and am searching for articles that will teach manual connection, insert, update and delete syntax in VWD, (C# and Sql Server).  Please refer to an article that you know of.  I would highly appreciate if the article uses a sample database and walkthoughs the whole page development where the page can insert, update and delete data, with no form views or details views etc. used. Need help urgently  Thanks!  Friend, here is the simplest way of inserting, editing and deleting in the asp.net http://www.codeproject.com/KB/database/simpledbreadwrite.aspx ...

C#
Assume I have a DataTable named People.  It has two columns, studentname and score. Assume record with studentname="Jane" has score=5 and I want to add 2 to it (score will be seven). What commands would I use to "read" the score where studentname is Jane, possibly put it into an int, add the 2 to it and then "write" the result, 7, in to replace the 5. If I was working with a table in SQL Server I would use SQL words in a SQL statement -- is there something analogous that I would use with my DataTable? I'm looking for keywords that I can google, or e...

updateable view ado.net sql server
Have any body use updateable view ado.net sql server . That is for example you have bind a grid with update able view[which comprises of multiple tables] Then you update data via updateable view. Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])Netprosys Inc.www.netprosys.comRemember to click "Mark as Answer" on the post that helps U Any Idea Guys ?? Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])Netprosys Inc.www.netprosys.comRemember to click "Mark as Answer" on the post that helps U...

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
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 ...

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
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 ...

creating ssis packagte for sql server to sql serer using C#.net
Hi friendsdoes any one has code or urls which can help me to create the ssis pacakage which will transfer data from sql server to sql server databaseswith some manipulationsthanks so much Lad LaxmikantPune You are probably in the wrong forum.  This forum is for questions relating to ASP.NET Dynamic Data. thanks,David...

Wanting to take info from one SQL table and update to a seperate SQL table
Anyone have an idea of how I can take information from one table and edit it and insert into another SQL table.  I am using stored procedures and would like to continue to do so. Here is a copy of what I have so far:   <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="mp_Customers" SelectCommandType="StoredProcedure"></asp:SqlDataSource> </div> <h2><strong><font color="#C00000">Please enter a valid account number:</font></strong><...

SQL Server Reporting Services for SQL SERVER 2000 AND Visual Studio.NET 2005 .NET 2.0
Hi, Which version of SQl Server Reporting Services will work with SQL SERVER 2000 in pararrel with ASP.NET 2.0 (.NET 2.0 framework)?  Thanks, Azam HighOnCodingWanna get high! Hi, Okay I got the answer. Yes, we can use the SQL SERVER 2005 Reporting Services with SQL SERVER 2000. HighOnCodingWanna get high! ...

Sql Server Express Triggers and asynchronous .NET update
Hi all, I'm hoping to write a .NET web application that can be updated asynchronously when a Sql Server Express database is updated.  Can this be managed with triggers? Thanks Toad...

Web resources about - Seperate Date and Time Merge; done at SQL Update or C# .NET then Update - asp.net.sql-datasource

Wii online play may use seperate friend codes for each game. Also: new DS Pokemon will feature VoIP
As we gaze into our online gaming crystal ball, we see much numerical text …

Recalls: Jaguar recalls 7k F-Types for two seperate issues with electrical system
Filed under: Convertible , Coupe , Sedan , Recalls , Jaguar , Luxury Jaguar is the latest automaker to join in on the recall action from this ...

China's Alibaba is Spinning Off its Aliyun OS Into a Seperate Business Unit
China's Alibaba bolsters its own mobile OS with $200M investment

Mariah Carey And Nick Cannon’s Glitter-Coated Marriage Is Probably Dead And They’re Living In Seperate ...
It feels like over the past 12 months, there have been a billion barely-even blind items (more like near-sighted items or items in which you ...

The Tea Party And Progressives Speak Seperate Languages In A Divided America
The state no longer mirrors the nation, but possesses a separate identity and sadly, its own agenda.

China Opens Seperate Walking Lane For People Texting
In an effort to raise awareness of the dangers of walking and texting, China has opened separate walkways for people who are using their cell ...

Clint And Dina Eastwood Seperate After 17 Years Of Marriage
Clint and Dina Eastwood have separated, having been married for 17 years. Dina is Clint’s second wife. On Friday, People magazine reported on ...

Le Mans Qualifying Red-Flagged Twice For Four Seperate Accidents
Le Mans qualifying was red-flagged for 45 minutes as the #71 AF Corse Ferrari went off at the Porsche Curves. No word on injuries but the driver ...

Bobby Flay and Stephanie March Seperate : People.com
"There have been problems for a while, so this was inevitable," a source tells PEOPLE

Singer k.d. lang Seperates From Domestic Partner Jaime Price
TMZ is reporting that out singer k.d. lang has finally dissolved her two-year domestic partnership with girlfriend Jamie Price. Lang, one of ...

Resources last updated: 12/4/2015 1:17:38 PM