|
Christian Graus wrote: you just need to know how to run a SQL command against an oracle DB
Ok,
Christian Graus wrote: just build your SQL and execute it.
And.. .. I mean once I do it, how do I read the output??
Maybe by using the ExecuteReader() .. Ok, Dont worry, I'll handle it, Thanks Christian
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
string strDesc = @"SELECT concat(column_name,',') ""Name"" FROM user_tab_columns WHERE table_name='TEST'";
OracleCommand oc = new OracleCommand(strDesc, con);
adap = new OracleDataAdapter(oc);
OracleDataReader oraDataReader = oc.ExecuteReader();
string strTemp = String.Empty;
while (oraDataReader.Read())
strTemp += oraDataReader.GetString(0);
strTemp = strTemp.Substring(0, strTemp.Length - 1);
MessageBox.Show(strTemp);
Thanks to you Christian
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
modified on Monday, April 14, 2008 4:16 AM
|
|
|
|
|
Awesome - glad you got it working.
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
I have a DataGridView which has a column of type double. How can i set that this column cells to be validated without reference to the decimal separator("," or ".")? Because the cell is validated only when the decimal separator in the value is identical to which is set in the regional settings.
Thanks.
|
|
|
|
|
I am page scraping to pull anywhere from 50,000 to 150,000 single string items that I would like to enter into my database. I have a very simple interface with a label, progress bar, and a button.
When I click the button I gets the information, and starts two threads, one enters data into the database, and the other updates the progress bar on how many have been entered verse how many need to be.
Everything works well, but it works very slow. I am following certain rules like leaving the connection open. I am also not using any Thread.Sleeps...
Any suggestions?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Expert Coming wrote: I am also not using any Thread.Sleeps...
There is most likely your problem.
Unless you have multiple CPUs or a multiple core CPU, only one thread at a time can run. Your thread that updates the progbress bar will update the progress bar once, then it will wait it's entire time slot for another change that will not happen, as it's blocking the thread that would do the change.
When there is nothing for the thread to do, you should do a Thread.Sleep(0) to give up the rest of the time slot so that another thead can use the CPU time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
That helped a ton. I moved the wait up to 1000 milliseconds and it was about the same. My old SQL Server must be the slow down, it seems like it goes fast for a while and then really bogs down, sounds like a SQL I/O issue.
Thanks.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
My form contains several controls like textbox, labels, buttons, panels etc..
To access these controls I used the following for loop.
foreach (Control ctrl in this.Controls)
{
}
Panel contains 36 checkbox controls. I'm unable to get checkbox controls in the for loop becoz those are in panel..
How to access and modify the properties of checkbox controls, which are in Panel. Thanks in advance..
|
|
|
|
|
The loop you are running will only get the controls in whatever Container this is (Usually a form, and looks like it is in your case). Run that same loop on the panel and you will get all the controls inside of it.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thanks for your prompt reply. Can you explain what does the following sentence mean?
the best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Reread my post, it got cut up all weird for some reason, I fixed it.
That is my signature. It means the only way to make a Mac is to drop it (preferably off a very tall building).
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
instead of this.Controls, loop through the controls in panel.Controls.
Or better yet, if they are dynamically created by you, when putting the checkbox in the panel, put them in a List/ArrayList so that they are easier to be referenced.
|
|
|
|
|
I am using the bitblt() function for printing a bitmap with c#. But the printing quality I am getting in this case is not satisfactory at all. Actually, the type of bitmaps that the 'BitBlt()' function requires are normally in the format of the display driver rather than the printer driver. So I am thinking of using a DIB rather than DDB and for doing this may be StretchDIBits() function can be used.
Please help me with some code sample on how to use the StretchDIBits() function in C#
Thanks in advance
Kamrul Hasan
|
|
|
|
|
You can use StretchDIBits if you want, using P/invoke. However, did you set the stretch blit mode of the graphics object you're using and see if that helped ?
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 )
|
|
|
|
|
Is it possible to backup and restore a MySql Database using C#?
How? Any suggestions?
|
|
|
|
|
Yes, it's possible: Get all tables, foreach table, get all columns and then create the script that will add this table into a Mysql database
|
|
|
|
|
This is somewhat confusing. Could you give me more specifics on what you're suggesting? Are you saying that I backup the database by placing it on another database?
I was thinking more around the grounds of backing up my database on a *.sql file and restoring it from a *.sql file using C#.
|
|
|
|
|
No, I was saying that you should create the sql script by yourself analyzing the structure of the current database
|
|
|
|
|
Ohhh... Hmm... Interesting... Thanks.
|
|
|
|
|
|
string fname = txtFileName.Text;
if (fname == "")
{
MessageBox.Show("Please Enter the File Name!");
return;
}
try
{
btnBackup.Enabled = false;
DateTime backupTime = DateTime.Now;
int year = backupTime.Year;
int month = backupTime.Month;
int day = backupTime.Day;
int hour = backupTime.Hour;
int minute = backupTime.Minute;
int second = backupTime.Second;
int ms = backupTime.Millisecond;
String tmestr = backupTime.ToString();
tmestr = "C:\\Program Files\\MySQL\\MySQL Server 5.0\\bin\\" + fname + year + "-" + month + "-" + day + "-" + hour + "-" + minute + ".bak";
StreamWriter file = new StreamWriter(tmestr);
ProcessStartInfo proc = new ProcessStartInfo();
string cmd = string.Format(@"-u{0} -p{1} -h{2} {3}", "root", "password", "Server", "dbname");
proc.FileName = "mysqldump";
proc.RedirectStandardInput = false;
proc.RedirectStandardOutput = true;
proc.Arguments = cmd;//"-u root -p smartdb > testdb.sql";
proc.UseShellExecute = false;
Process p = Process.Start(proc);
string res;
res = p.StandardOutput.ReadToEnd();
file.WriteLine(res);
p.WaitForExit();
file.Close();
MessageBox.Show("DataBase Backup Has Been Completed Successfully!");
btnBackup.Enabled = true;
}
catch (IOException ex)
{
MessageBox.Show("Disk full or other IO error , unable to backup!");
}
txtFileName.Text = "";
|
|
|
|
|
Hi,
does anyone knows how to ge the size (area value) of an inregular shape in a bitmap image.
i have a bitmap image with a black background and the shape is all in white, i wonna get the size of the shape and say yes if the shape has rugged edges or no if its more like a circle.
I appreciate any help.
|
|
|
|
|
You could look at my image processing articles for info on direct pixel access, then you could walk the image and see if it has straight edges.
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 )
|
|
|
|
|
Now, I'm very curious, did you actually find that function name (sig) in a real life application, or it's just a sig?
|
|
|
|
|
It was a method in code someone posted here asking for help.
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 )
|
|
|
|