|
<>Hi,
This is ravindra ,I created the following function and able to execute the followed query
successfully in sql plus but when i try to execute the same query through code,getting error like
Unspecified error
Oracle error occurred, but error message could not be retrieved from Oracle.
Data type is not supported.
Create or Replace Function convert_time(datetime in timestamp, tz1 in varchar2, tz2
in varchar2)
Return timestamp with time zone
as
retval timestamp with time zone;
Begin
retval := from_tz(datetime, tz1) at time zone tz2;
return retval;
End;
select convert_time(to_timestamp('01/01/2006 23:45','mm/dd/yyyy
hh24:mi'),'US/Eastern','Turkey') from dual;
the .net code as follows
string conn = "Provider=MSDAORA.1;Password=;User ID=;Data Source=naradaon;Extended
Properties=Server=naradaon";
OleDbConnection con = new OleDbConnection(conn);
con.Open();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter("select from_tz(to_timestamp('01/01/2006
23:45','mm/dd/yyyy hh24:mi'),'-05:00') as hio from dual", con);
da.Fill(ds);
Please help me
thank you
<>
|
|
|
|
|
Try writing a parameterised query. I'm surprised this SQL works, I thought you needed select *, not just select. Could be an Oraclism tho.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use OracleDataAdapter instead.
(using Oracle.DataAccess.Client)
string conn = @"...."; // make sure you use the correct one
string strSel = @"select from_tz(to_timestamp('01/01/2006 23:45','mm/dd/yyyy hh24:mi'),'-05:00') as hio from dual";
OracleDataAdapter da = new OracleDataAdapter(strSel, conn);
DataSet ds = new DataSet();
da.Fill(ds);
SkyWalker
modified on Thursday, May 1, 2008 10:52 AM
|
|
|
|
|
Hi,
For those who don't know, in Windows Vista when you hold shift down and right click a folder a few hidden options (Copy as Path, Command Wind Here)
I was wanting to implement a similar feature in my program - mainly for debugging purposes.
For example on my grids when you right click on the Header it displays all column names and lets you show and hide them. I would like it so if shift was pressed it would put the width of the column after it.
Any ideas?
|
|
|
|
|
Figured it out - ModifierKeys == Keys.Shift
|
|
|
|
|
Hi all,
Now I need a solution to open the internet explorer in a new window.Also I need to display message "PROCESS OVER"/"ERROR" Depending upon the value taken from the user in the newly created window.
plz help,
regards,
syamooo...
|
|
|
|
|
Process.Start("http://www.codeproject.com");
will open a new IE window. If you open an external IE window, you can't interact with it. If you want to, then you need to put a web browser control on a form, and show the page in that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris,
thanks for ur answer.Also i want to know how to pass parameters to page.For eg:there is page which contains a function which will executed on the page_load event.If it takes an argument as a string and the function will simply display it in a label.My question is how to pass the input string to the function from a page .
|
|
|
|
|
Oh, this is an ASP.NET question, or just the site you launch from your winforms app is your own to control ? The way to pass parameters to a web page is to put them on the query string.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Process.Start("http://www.codeproject.com");
This opens the page in the default browser (Firefox on my machine).
I think the correct way is Process.Start("iexplore.exe");
|
|
|
|
|
Yeah, I said it opens the default browser. If you want to force IE, you need to pass the URL as an argument, that may work.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Yeah, I said it opens the default browser.
Actually you didn't say that anywhere
|
|
|
|
|
you're right
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: will open a new IE window
Thats not quite true. If there is an open window it will hijack it, and redirect to the supplied webpage. Actually calling iexplore.exe will definately open a new window. I did write up some code a while ago, to find the users default browser and start a new instance of it on a webpage. I hate when something starts taking over my browser windows.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
I have written a C# app, where I used WebBrowser control to visit any webpage. If there is a download in this page, and I want to download it IE7 default download manager pops up and starts download. But I want to use custom download manager (viz. one embedded with my app) to download file from webbrowser control.
How to solve the problem? Please help me. I am stuck there.....
Thank you in advance.
Anindya Chatterjee
|
|
|
|
|
Right then. WebBrowser has an event for Navigating , which gets called just before the control starts redirects to the new url.
You'll need to use the event, and check the extension of the file being downloaded. If the extension is any kind of webpage (htm, html, asp, etc) then you can just ignore it. If the extension is something else (rar, mp3, doc, etc) then you will need to cancel the event, and start your custome downloading code on the url.
A quick example:
void WebBrowser1Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if(e.Url.AbsoluteUri.EndsWith(".html"))
{
return;
}
e.Cancel;
}
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
what if it goes to an ASP, PHP, ASPX, DHTML, SHTML, JSP, ect.. page?!?!
You "could" create a web client object that spits it's request into the webbrowser control to be displated. Then you have access to the HTTP headers! but, then you can't port it over to the compact framework without lots of work openNETCF library only to find a bug in openNETCF and have your project grind to a halt to be canceled
|
|
|
|
|
You mean if you go to an asp page and then it automatically downloads a file? Because i think that would trigger the Navigating event as well.
If you mean i only put in an if statement for html, then it was just an example of how you could solve the problem.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
The problem with that is you can't account for every type of viewable file on the web
ranting about how you can't grab the HTTP headers from the web browser control, as I've been in a similar issue trying to "capture" POST data from the web browser...
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Thanks, very much. My problem has been solved by your solutions. Thanks again.
Anindya Chatterjee
|
|
|
|
|
I have to use SGEN on an strongly named assembly that uses XmlSerializer
"sgen.exe"
"$(TargetPath)"
/f
/out:"$(TargetDir).."
/compiler:/keyfile:"d:\new folder\outlookSyncSign.snk"
The problem is that if the folder where the strong name key file has spaces the command will be unsuccessful. How can I overcome this without changing the name of the folder where the strong name resides?
|
|
|
|
|
try reating a batch file, then run the batch file from the post build event. You could pass in the target path and the output location if necessary, or just "hard code" them in the batch file...
|
|
|
|
|
it seems i get the same result using the batch file also, this is what i placed in the batch file
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe"
"c:\myApp.exe"
/f
/out:"d:\new folder"
/compiler:/keyfile:"d:\new folder\myAppsnk.snk"
I found this post And they it's a bug with sgen but i'm not sure i understood the workaround
|
|
|
|
|
If you put the path in quotes then you shouldn't have a problem.
|
|
|
|
|
as you can see in my post, the path is in quotes, it seems, according to this guy that's is a bug in sgen tool here
I tried using a batch file but i get the same result
|
|
|
|