|
Just found another way round by generating the desired script file, storing it in a temporary file and execute it from SQLPLUS. Here's how:
string strSEQ =
@"DECLARE
N NUMBER(10);
BEGIN
SELECT MAX(ID)+1 INTO N FROM "+ strTableName +@";
-- CREATING SEQUENCE
Execute immediate ('DROP SEQUENCE SEQ_TEMP');
Execute immediate ('CREATE SEQUENCE SEQ_TEMP
MINVALUE 1
START WITH '||N||'
INCREMENT BY 1
CACHE 20
ORDER');
END;
/
";
string strTempFile = Environment.GetEnvironmentVariable("TEMP")+"\\tmp_SCRIPT.SQL";
string CR = "\r\n";
System.IO.StreamWriter sw;
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
p.StartInfo.CreateNoWindow = true;
p.EnableRaisingEvents = true;
p.Exited += new System.EventHandler(p_Exited);
p.StartInfo.FileName = @"SQLPLUS.exe";
sw = new System.IO.StreamWriter(strTempFile);
sw.Write(strSEQ);
sw.Flush();
sw.Close();
p.StartInfo.Arguments = @"USERNAME/PASSWORD @" + strTempFile + " >> " +
strTempFile.Replace(".sql",".log");
p.Start();
}
private void p_Exited(object sender, EventArgs e)
{
MessageBox.Show("Done");
}
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
How to lock datagrid column width adjustment at runtime
thanks
|
|
|
|
|
Use the AllowUserToResizeColumns property. Read all about it here[^].
I are troll
|
|
|
|
|
Hi,
you can use the template of DataGrid using table and set the table td width
I am sure this will solve your problem
Thank You
Vinod Kr.
|
|
|
|
|
hello....i have created a socket in my application and i need to send the data over an interval of 10 seconds so am creating a new socket in the timer.
the problem with this approach is that the application is creating a new socket every 10 seconds so that my server is getting lots of exceptions...
may i know is it possible to send the data over a single socket insted of creating a new socket every time i need to send the data..
thanks...
|
|
|
|
|
Just create 1 socket connection. Just write to that stream every 10s.
You don't need to create a socket connection every 10s.
|
|
|
|
|
thans for that... but am using asynchronous sockets.. so i would be thankful for u if u give me a hint how to write to the single socket stream....
|
|
|
|
|
Hi,
How can i check the Check directory exist is FTP?
Thankyou
YPKI
|
|
|
|
|
What do you mean?
You want to check if an ftp address exists? (just try to connect to it)
You want to check if a directory exists? use directory.exists
You want to check if a certain directory is a directory that is being exposed by an ftp program? See if you can connect to the folder with an ftp connection.
You want all the directory's of an ftp? There is tons off code out there for doing this just google 'ftp +c#.net'
On a side note: next time be a bit more clear about what you want, maybe give a short example.
|
|
|
|
|
Do you mean you want to check if a directory path is FTP? If so, just use the string.StartsWith function - if it starts with ftp://, then it's an FTP directory
|
|
|
|
|
What exceptions cannot be caught by try-catch block?
StackOverflowException for one. (Just try write a simple infinite recursive function and invoke from a simple WIN32 console main)
What else?
dev
|
|
|
|
|
There aren't that many that can't be caught. Off the top of my head, the only other one I can think of is an OutOfMemoryException.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: the only other one I can think of is an OutOfMemoryException.
I'm sure I've got code that catches those?
It definitely isn't definatley
|
|
|
|
|
well here's one mysterious
<br />
try {<br />
IPerson oPerson = ISession.Get(....);<br />
...<br />
oSomeProperty = LoadProperty(...);
<br />
oPersom.SomeProperty = null;
oPerson.SomeProperty = new PersonProperty(...);
oPerson.SomeProperty = oSomeProperty; oPerson NOT NULL!!<br />
<br />
<br />
} catch(Exception ex)<br />
{<br />
Console.WriteLine("Tell me everything..."); Exception? try-catch never caught it?!<br />
}<br />
<br />
class Person<br />
{<br />
protected PersonProperty _SomeProperty = null;<br />
...<br />
public PersonProperty SomeProperty<br />
{ <br />
get { return _SomeProperty; }<br />
set {<br />
_SomeProperty = value; << Actually it crashed right here.<br />
}<br />
}<br />
...<br />
}<br />
no clue - even if it was a stackOverflowException Visual Studio will tell me. But this one, I step as close to problem as I could by tracking it down to SomeProperty setter in Person class. I can't go lower - I don't have .NET source code!
dev
modified on Wednesday, April 1, 2009 5:25 AM
|
|
|
|
|
There was an article[^] posted in the lounge the other week converning problems with the Large Object Heap (LOH).
There is some sample code in there that catches out of memory exceptions and forces a GC.Collect(). I suspect that this might only work because the the LOH is unable to allocate more memory but there is still available memory in the small object heaps (SOH). I'd imagine that if you were to use all memory on the SOH's that you wouldn't be able to catch the exception, but there are definitely circumstances where the exception can be caught and handled appropriately.
It definitely isn't definatley
|
|
|
|
|
hey appreciate it, let me take a look at this NOW! i've been tormented... this "SomeProperty" is actually a complex object graph but at the time when this failed (which happens every single time so it's not like it's sporadic or indeterministic) the graph is quite shallow/simple... alright let me clear my head and start reading!
dev
|
|
|
|
|
oh... it's not LOH because at the time when it breaks the object graph still small - i.e. far less than 85,000 bytes (My guess is that it should be about 5000 bytes only, there's no easy way to determine size of complex graph of reference type... so...)
dev
|
|
|
|
|
I've found it
some framework code called Person.ToString after setter set, which resulted in infinite recursion (parent->child->parent sort).
Thanks!
dev
|
|
|
|
|
Off the top of my head, the LoaderLock exception seem to slip through the net. But anything that's invoked by Environment.FailFast seems to do the trick
|
|
|
|
|
class Node
{
int[] State = new int[2];
Node *[] Ptr;
}
how can i have a class like this please help me to use unsafe keyword for using this array of pointer and how can I declare my Ptr array cells?
|
|
|
|
|
unsafe class Node<br />
{<br />
fixed (int* ptr = &array[10])<br />
}
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Hi friend
How to create windows xp user using c# code
plz help me
Thanks and regards
Azad yadav
|
|
|
|
|
Check the DirectoryEntry class and the objects Invoke method...
Have a Happy Coding.....
|
|
|
|
|
|
Hello.
Problem: Need import from CSV file information in the GridView.
File Format:
"MachineName", "Hostname", "IP Address" (to a new line)
"Machine", "MachineHost", "127.0.0.1" (to a new line)
"Machine2", "MachineHost2", "127.0.0.1"
And respectively insert into GridView, with fields : MachineName, Hostname, IP Address.
Thanks.
|
|
|
|