|
|
how to use the multithreading concept in an MDI form
Titli
|
|
|
|
|
Your going to have to be ALOT more specific about what you want. All you've done so far is ask "How to use a knife in the kitchen?".
What do you want these other threads to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there any way to get the value of a Paragraph Leading? i.e. the distance between two consecutive (base) lines of an RTF page?
please guide
|
|
|
|
|
I think my question was not giving the entire information.
I want to find the way to get Paragraph leading when any image is inserted in the page. In my case if I insert images in consecutive lines irrespective of image height the distance between two images remains same. Where as it differs in case of text, if font size is changed.
I want to fetch the paragraph leading in case of image, to calculate exact base line to base line height for page layout purpose. In case of normal text, Font.Height solves my purpose.
regards
|
|
|
|
|
I have several text files with 150,000 unique English words that I want to INSERT INTO an MDB file that has a table for words with 3 letter, 4 letter, 5 and so on.
I've scoured MSDN and all my printed C# documentation but can not find an example of what the correct syntax is.
There are 4 files Nouns, Verbs, Adjectives and Adverbs.
Here is what the beginning of the Nouns file looks like:
entity
thing
anything
something
nothing
nonentity
whole
wholething
unit
livingthing
animatething
organism
being
benthos
heterotroph
life
biont
cell
causalagent
I've got about 20 hours into this and the C# code invariably boinks on a sytax error in the INSERT INTO command.
I would appreciate any leads that someone could contribute.
Thank you very much,
Bill Prada
bprada@comcast.net
Best Regards,
Bill Prada
|
|
|
|
|
bprada wrote:
C# code invariably boinks on a sytax error in the INSERT INTO command.
Well, you show us the list of words, but not the INSERT command.
But it should look like this:
OleDbCommand cmd = new OleDbCommand("INSERT INTO Table3Letters VALUES (?);", conn);
cmd.Parameters.Add("@param1", strMy3LetterWord);
cmd.ExecuteNonQuery();</code> Good luck!
Check the syntax of the INSERT statement here[^].
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Thanks for the quick response.
Here is a snippet:
I've read the text word and am trying to put a one Char string in each field.
switch (nCharCount)
{
case 3:
cmd.CommandText = "INSERT INTO 3 VALUES ca[0], ca[1], ca[2]";
cmd.ExecuteNonQuery();
break;
case 4:
cmd.CommandText = "INSERT INTO 4 VALUES ca[0], ca[1], ca[2], ca[3]";
cmd.ExecuteNonQuery();
break;
case 5:
cmd.CommandText = "INSERT INTO 5 VALUES ca[0], ca[1], ca[2], ca[3], ca[4]";
cmd.ExecuteNonQuery();
break;
case 6: /* The first word in Nouns.txt has 6 letter so I am trying different thinggs here */
try
{
OleDbDataAdapter myAdapter = new OleDbDataAdapter();
DataSet ds = new DataSet("six");
myAdapter.Update(ds, "C:\\Keep\\Gloss\\Working Data\\Gloss.mdb.6");
cmd.CommandText = "INSERT INTO '6' (1, 2, 3, 4, 5, 6) VALUES ('cA[0].String()', cA[1].ToString(), cA[2].ToString(), cA[3].ToString(), cA[4].ToString(), cA[5].ToString()";
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
break;
I hope this shows what I am doing wrong
Best Regards,
Bill Prada
|
|
|
|
|
From that code, I suppose your tables have one field for each character (so, the 3-char-words table has 3 fields).
Your INSERT commands, in cases 3, 4 and 5, are missing parenthesis:
INSERT INTO Table VALUES <big><big><big><big>(</big></big></big></big>field1, field2, ...<big><big><big><big>)</big></big></big></big>; -- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
bprada wrote:
cmd.CommandText = "INSERT INTO 3 VALUES ca[0], ca[1], ca[2]";
And also, the ca[n] are variables, so you should put them out of the string literal, and since their data type is char , enclose them in single quotes in the SQL statement:
cmd.CommandText = "INSERT INTO 3 VALUES ('" + ca[0] + "','" + ca[1] + "','" + ca[2] + "')"; But I don't recommend string concatenation as it is any easy way to allow SQL-injecton attacks. So I'd use the Parameters property of the OleDbCommand as I mentioned in my first post:
OleDbCommand cmd = new OleDbCommand("INSERT INTO 3 VALUES (?, ?, ?);", conn);
cmd.Parameters.Add("@param1", ca[0]);
cmd.Parameters.Add("@param1", ca[1]);
cmd.Parameters.Add("@param1", ca[2]);
cmd.ExecuteNonQuery(); And by the way, in your case 6, you also need to change your SQL statement so you take your variables our of the string literal (or better yet, use parametized queries.)
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hi,
basically I am a VB/ASP developer, and I am poor in OOP's concepts. I just started learning C#, and when I am trying to execute my first C# program which i got in one book, after execution it is not returning any line to out put screen. plz help me in this.
CODE:
<br />
using System;<br />
<br />
namespace Wrox.ProCSharp.Basics<br />
{<br />
class MyFirstCSharpClass<br />
{<br />
static void Main()<br />
{<br />
Console.WriteLine("This isn't at all like Java!");<br />
Console.ReadLine();<br />
return;<br />
}<br />
}<br />
}<br />
nagarajuepuri
|
|
|
|
|
Check if you created a console application or a windows application. On project properties, check "Output Type", and set it to "Console Application".
If you set it to "Windows Application", it will have no console and all your Console.WriteLine will be ignored.
Yes, even I am blogging now!
|
|
|
|
|
Thanks for you intrest...
actually, i didn't get you exactly.
I have written this code in a text file and saved it with .CS extension, then i have executed this "sample.cs" file through command line like....
"csc sample.cs"
Here i am not at all creating any application nor project, i am executing all my code through command line only.
thanking you in advance,
nagarajuepuri
|
|
|
|
|
You've only compiled the program, you need to execute it. By default, the executable is placed in the same directory where you compiled it and is named after the source file you compiled. So go to the directory where you compiled and run sample.exe .You'll see the output.
Regards
Senthil
|
|
|
|
|
hi ...
first of all u should add the path of the .Net framework to ur system variables (environment variables -> PATH).
to create an exe file u should ask for this in the command u r using to compile the code sample ... to know the exact syntax of all options u can use with CSC , write "csc /?" (of coursr without the double qoutes).
i hope this helps.
|
|
|
|
|
Thanks you all, I got the solution, once again thanks to you all.
.exe file is created when i compiled the code, then when i executed that, i got the desired output of the program.
but let me clear one thing, can't we get that output at the time of compilation it self???
thanks once again
|
|
|
|
|
Only if you write a batch file to do the compile first, then execute the program. The command line compiler will not launch the finished .EXE for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know how to hide the icon on a windows form?
i have an MDI app and when i call a child form, an icon is displayed in the top left of the child. i dont want this for my child forms because it throws off the main Parent forms toolbar.
any help would be appreciated.
thanks,
.gonad.
|
|
|
|
|
you can change the type of the frame of ur forms to fixedDialog.
i hope this helps
|
|
|
|
|
thanks for the reply but it still shows on the form. when the child form is maximized inside the parent, the icon for the child form shows in the top left of the parent form (directly to the left of the 'file' menu). its the 'control' icon (restore,move,size,min,max,close). there is no way to remove this icon from what ive seen or tried.
thanks,
.gonad
|
|
|
|
|
I am trying to create a card selection screen like the one in Windows Solitaire program in C#. I know how to use the cards.dll and can make the card back draw on the screen but what I am trying to figure out is how to:
1) Make them Clickable objects
2) Make it so that when one is clicked, it is highlighed with a border to indicate it is the one selected.
If anyone can help, it would be appreciated.
Thanks.
|
|
|
|
|
Ok, I know there is File.Exists and there are ways to pull out comments from the FileInfo but is there a way in C# .NET to find out if a certain file is signed with a security certificate or not?
|
|
|
|
|
fast way to find the index of the first letter in a richTextBox?
|
|
|
|
|
A regular expression.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
How???(Do you know?) I need the position of the letter
|
|
|
|
|