473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cannot format System.String to DateTime when using Oracle.DataAccess.Client with ObjDatasource

I have a simple textbox control

<asp:TextBox ID="calendar" runat="server" CssClass="textbox"></asp:TextBox>
( Would be changing it to a calendar control) on a page .I want the user to
type in a date e.g 2/06/2008 and
hit submit

The parameter is being sent to an oracle Db.
My select statement looks like below:

Select dt,a,b from Mytable where (to_char(DT, 'D/MM/YYYY') LIKE conc(:pdt)

My Control Parameter looks like below
<asp:ControlParameter ControlID="calendar" Name="pdt" PropertyName="Text"
Type="String" />
I have tried to format the date string like below:

but no luck
String.Format("{0:D/MM/YYY},calendar.text.ToString())
and added the parameter in the ObjectDataSource_Selecting event but no
LUCK.

Any ideas?


Jul 17 '08 #1
1 2180
On Jul 17, 2:40*pm, "Patrick.O.Ige" <naijaco...@hotmail.comwrote:
*I have a simple textbox control

<asp:TextBox ID="calendar" runat="server" CssClass="textbox"></asp:TextBox>

( Would be changing it to a calendar control) on a page .I want the user to
type in a date e.g 2/06/2008 and
*hit submit

*The parameter is being sent to an oracle Db.
*My select statement looks like below:

*Select dt,a,b from Mytable where (to_char(DT, 'D/MM/YYYY') LIKE conc(:pdt)

* My Control Parameter looks like below
*<asp:ControlParameter ControlID="calendar" Name="pdt" PropertyName="Text"
* * * * * * * * * * Type="String" />

I have tried to format the date string like below:

but no luck

String.Format("{0:D/MM/YYY},calendar.text.ToString())
*and added the parameter in the ObjectDataSource_Selecting event but no
LUCK.

Any ideas?
This format could be a problem: String.Format("{0:D/MM/
YYY},calendar.text.ToString())

Correct to YYYY (4 times Y) and try again. If it's still not working
try to debug and check what do you get after the String.Format was
applied.
Jul 19 '08 #2

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
0
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and...
14
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style...
3
by: Just D | last post by:
Did anybody see this bug? I tried to reproduce that using 12-hour and 24-hour system settings. Anyway it still causes a problem in VS2003. When I convert DateTime to a string using default...
2
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
13
by: Roy | last post by:
Hi all, I'm creating a project that should always use this date format when displays the dates or create dates. The back end database is a SQL Server and I like to know what is the logical way...
12
by: Rob Meade | last post by:
Hi all, Ok - I've come from a 1.1 background - and previously I've never had any problem with doing this: Response.Write (Session("MyDate").ToString("dd/MM/yyyy")) So, I might get this for...
3
by: chris | last post by:
When I tried to import system.data.oracleclient, it was not available. Do I need to install anything for being able to use it ?
7
by: groups | last post by:
This is my first foray into writing a generic method and maybe I've bitten off more than I can chew. My intent is to have a generic method that accepts a value name and that value will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.