|
Khoramdin wrote: You should POST the entire message
You mean like the like above the reference?
Khoramdin wrote: By the way, didn't take your advise and managed to solve the problem.
Good for you. It is helpful to others to post the solution. If indeed you have solved it yourself. Perhaps someone with more experience just finished it for you. "wink*
only two letters away from being an asset
|
|
|
|
|
ha ha ha...
I wish someone had solved it for me, mate! I truly cracked my head on that BHO and believe me when I tell you that I was so excited when it got working!
I cannot deny the fact that I read nearly a milliion posting and articles before I managed to get it up and running.
I am actually thinking of creating a STEP BY STEP and detailed tutorial and submit it to codeproject regarding the BHO. My finding was that, expect one or two articles; there isn't much of information on BHO on Internet.
It is good to see you have a delightful sense of humor. Happy thanx-giving, mate.
Khoramdin
|
|
|
|
|
how I can insert image into sqlserver database with c#.
|
|
|
|
|
how I can insert image into sqlserver database with c#.Ineed the code
|
|
|
|
|
|
Hello yemen_programmer,
As far as I know, there are TWO ways to do so.
1- To store only the location of the image into your database and the image file in a different folder.
2- To store the image file as a BLOB file.
The option 1 is stright forward as you only store a text into your database while your image sits in a folder. Therefore, I am going to leave that.
The second option can be done with a code similar to the one here. Keep in mind that this line of code uses MySQL database and the command line "INSERT INTO ....." may be different for SQL and you need to check that out. I personaly use MySQL. The following code also includes storing other information about the stored image. But the most important one that you require is ItemImage and ImgeSize.
OdbcCom = new System.Data.Odbc.OdbcCommand("INSERT INTO item VALUES (NULL, ?, ?, ?, ?);", OdbcCon);<br />
<br />
OdbcCom.Parameters.Add("@ItemName", System.Data.Odbc.OdbcType.VarChar);<br />
OdbcCom.Parameters["@ItemName"].Value = txtItemName.Text;<br />
<br />
OdbcCom.Parameters.Add("@ItemImage", System.Data.Odbc.OdbcType.Image);<br />
OdbcCom.Parameters["@ItemImage"].Value = ImageArray;<br />
<br />
OdbcCom.Parameters.Add("@ImageSize", System.Data.Odbc.OdbcType.Int);<br />
OdbcCom.Parameters["@ImageSize"].Value = FileSize;<br />
<br />
OdbcCom.Parameters.Add("@ItemInfo", System.Data.Odbc.OdbcType.VarChar);<br />
OdbcCom.Parameters["@ItemInfo"].Value = txtItemInfo.Text;<br />
<br />
OdbcCom.ExecuteNonQuery();
Keep in mind that before being able to do so, you need to place your image in an Array which in the above code is called ImageArray.
I hope that could help you out to get your image into your database.
Cheers,
Khoramdin
-- modified at 14:49 Wednesday 21st November, 2007
|
|
|
|
|
Hello, anyone know a way to create a shortcut in vista. I try the usual path to generate it in XP, but it's a permisson problem in vista that you've to put your exe with adm priv on the manifest. Any idea?
|
|
|
|
|
You have to download the file top open it.
Think about it for a moment, you have your temporary internet files, which is everything you see or hear on the internet. IE, or FF download the files from the internet and store them in its temporary directory, and then displays the content to you.
EDIT: Whats up with this message eh? Its got a line above it, as though its a reply to some other thread.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
|
There is a class in the .NET framework that will do much of this for you: FileSystemWatcher[^]. Have you looked at it?
|
|
|
|
|
Just a couple of things on formatting your post.
1. Use the <code></code> tags for small snippets of code
2. Use the <pre></pre> tags for larger peices of code, like yours.
3. Alot of the lines in your code are '///' or blank lines, which just take up space and decrease readability.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
This looks remarkably like homework to me. Thats just the sort of Skeleton I might provide to a class and ask them to fill in the gaps!
Regardless why don't you have a crack and if you hit upon a specific issue then im sure someone here'll help you.
|
|
|
|
|
Strange, you post your message, and then the post is deleted shortly after...
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hi,I need a Sample code for setting for example ReportViewer1.BorderStyle in my source file.when i run my project in C#,there is a error message for this code: ReportViewer1.BorderStyle="solid".How can i write code like this without using ReportViewer Toolbar before running the project to define my Report Page setup as like as BorderStyle seting ,page setup setting for example my papaer size to be A4 and margin setting and other properties of my Report without defining this properties at running time or design time only with writing code in source file in my report from ?
thanks
D.riazi
|
|
|
|
|
Davood Riazi wrote: there is a error message for this code: ReportViewer1.BorderStyle="solid".
Surely you need to supply some kind of enum rather than a string.
What does the documentation say? (Let me guess, you haven't read it)
Well, in that case I can tell you that the BorderStyle[^] property takes an enum of type BorderStyle[^]
Davood Riazi wrote: How can i write code like this without using ReportViewer Toolbar before running the project to define my Report Page setup as like as BorderStyle seting ,page setup setting for example my papaer size to be A4 and margin setting and other properties of my Report without defining this properties at running time or design time only with writing code in source file in my report from ?
By reading the documenation. It is all in there.
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
Hi dear Colin Mackay
Thanks alot for your response.
D.riazi
|
|
|
|
|
Hi All,
I am adding a string value to listbox control. I need to set the width of listbox in runtime base on how many pixels string need it to display it within listbox. Idea is to set a width of listbox exactly the number of pixels required by string value. So, I can have perfact width each time base on string value.
Any idea please help.
Thanks,
Asif.
A.Asif
|
|
|
|
|
look into the Graphics object. I think you can calculate the width of a string there, but you'll need to pass the font properties as well.
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
TextBox tb = new TextBox();
...
Graphics g = null;
try {
g = tb.CreateGraphics();
SizeF result = g.MeasureString(tb.Text, tb.Font);
// you may need to take into account margin, padding, or border sizes
tb.Width = (int)Math.Ceiling(result.Width);
} finally {
if (g != null)
g.Dispose();
}
Jeff
|
|
|
|
|
Hello there,
Well, my question is quite simple, i'm working on synchronization between threads, and one thing i'd like to know is if there's a way to know if a thread is paused by an event.WaitOne() ...
Imagine the code below, using an eventGate declared as a ManualResetEvent acting like a gate (eventGate.Set ()= gate open, eventGate.Reset() = gate closed) :
private void myThread(){
while(!stop){
eventGate.WaitOne();
anyFunction();
}
}
Is there a way to know if i am now waiting in the WaitOne() function ?! Because i really need to in order to process the other commands in the other threads i got !
Best Regards,
Mamat,
|
|
|
|
|
Hi, you may want to read up on the Thread.ThreadState property
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
I've allready thought of using that property untill i realise it wasn't possible ...
Actually, using ThreadState is not reliable since threads are most of the time in WaitSleepJoin mode due to time-slicing
Best Regards,
Mamat,
|
|
|
|
|
In a process where there isn't much calculations going on (say a text editor) all
the threads are likely to be waiting for something to happen, such as a keyboard hit,
a mouse move, whatever.
In a process with lengthy calculations you will see threads that are not in WaitSleepJoin
state. Here is a simple test:
void Test() {
List<Thread> threads=new List<Thread>();
for(int i=0; i<4; i++) {
Thread t=createThread("T"+i);
threads.Add(t);
}
for(int i=0; i<100; i++) {
Thread.Sleep(300);
Console.WriteLine("tick "+i);
foreach(Thread t in threads) {
Console.WriteLine("Thread "+t.Name+": state = "+t.ThreadState);
}
}
}
Thread createThread(string name) {
Thread t=new Thread(new ThreadStart(runner));
t.IsBackground=true;
t.Priority=ThreadPriority.BelowNormal;
t.Name=name;
t.Start();
return t;
}
void runner() {
for(int j=0; j<100; j++) {
for(int i=0; i<100000000; i++) { }
Thread.Sleep(1000);
}
}
Half of the time, some of the threads are in WaitSleepJoin (due to the Thread.Sleep in
runner), the other times they are really running.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This is what i've read from MSDN :
"Your code should never use thread state to synchronize the activities of threads."
Would be so easy that way, too bad it can't work ...
Do you have any other idea ?
Best Regards,
Mamat,
|
|
|
|
|
Karma Komae wrote: Do you have any other idea ?
Yes. Start by stating your problem.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|