|
An insert query for that is rather simple. Example:
insert into someTable (aMemoField) values ('This is a test...')
When you do it from code you should use a parameterised query, though. Then you don't have to worry about apostrophes and correctly escaping strings (which is rather crucial to protect against SQL injection attacks).
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Here is my updated Code utlizing a parameterised query. I still get an error on my Insert Command stating: Syntax error in INSERT INTO statement.
The first field is a key and is a long int
The second field is a Text Field 255 long
Here is the code that does the insert. Please let me know of any issues. I can't find any:
string commandText = "INSERT INTO Contact_Notes (Contact_ID,Note) VALUES(@Contact_ID,@Note)";
string strConcat = "**** " + g_ProfName + " " + DateTime.Now.ToString() + " **** " + txtNewNote.Text;
conProspect.Open();
OleDbCommand cmd = new OleDbCommand(commandText,conProspect);
cmd.Parameters.Add("@Contact_ID", lngContactId);
cmd.Parameters.Add("@Note", strConcat);
cmd.ExecuteNonQuery();
conProspect.Close();
cmd.Dispose();
As always thanks for all the help
|
|
|
|
|
If I remove the Note field. It works just fine...
|
|
|
|
|
Note is a reserved keyword in the JET database driver. Change the name of the field, or if that is not practically possible, put brackets around the name in the query: [Note] .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
any way how I can do that?? I want to convert html to pdf, what is the way to do this. How should I start? Thx ahead
|
|
|
|
|
There are only two options that I'm aware of... The first is to get one of the open source PDF APIs, build your own HTML parser, and with those two in hand build a converter yourself. Option two is buy a package that does it for you. There are a few out there, though it's not really easy to get past the specialty acts and find a tool that does just that. I have used ExpertPDF[^] and it's a decent product, and not too expensive. Good luck.
Visit BoneSoft.com for code generation tools (XML & XSD -> C#, VB, etc...) and some free developer tools as well.
|
|
|
|
|
You can always install a pdf printer driver such as doPDF.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I have a client / server system which uses sockets to send a receive messages. The messages are then processed on the server and a response sent back. This all works as expected most of the time but in the case of one particular message, it requires an arbitrary amount of data to follow it so I attach a NetworkStream to the Socket (specifying false to 'ownsSocket' so as not to close the socket early). Now this also works fine but some time after using the NetworkStream I get a message received twice in a single Receive call. The client has not sent it twice but it was received twice. This may happen for the message after I use the NetworkStream or after 100 successful messages after, there seems to be no pattern to it.
Now this also seems to happen less and less the more debug messages I add to the application making it very hard to find the problem.
The NetworkStream is closed and disposes after use.
Does anyone have any idea what could be causing this? Could it just be coincidence that it seems to only happen after I use a NetworkStream?
|
|
|
|
|
__DanC__ wrote: The NetworkStream is closed and disposes after use.
Try without closing the NetworkStream.
|
|
|
|
|
Just tried that but it didn't make any difference.
|
|
|
|
|
Client maybe closing the connection?
|
|
|
|
|
Hello,
I use hotkey for activate my form with the NotifyIcon.
It work but i still want to send the HotKey to the current activated application also.
I use '²' key on my french keyboard (only akey simultanous).
code:
protected override void WndProc(ref Message m){
base.WndProc(ref m);
if (m.Msg == WM_HOTKEY){
if (contextMenuStrip_fenetre.Visible)
{
this.ferme_fenetre();
}
else
{
this.affiche_fenetre();
}
}
}
public void RegisterGlobalHotKey(Keys hotkey, int modifiers)
{
String atomName = AppDomain.GetCurrentThreadId().ToString("X8");
GlobalAddAtom(atomName);
RegisterHotKey(this.Handle, hotKeyId, modifiers, (int)hotkey);
modified on Tuesday, July 1, 2008 2:35 PM
|
|
|
|
|
|
|
Thanks,
I have read totally articles, there are very interesting.
But, it doesn't match my feature.
( My hotkey is '²' )
exemple:
I am under a text editor, and i am writing a document.
and, I want to press the char '²'.
The Char isn't send to the text editor.
The Char is send to my owm app that catch it ( by hotkey system).
Conclusion:
so, I don't know activited/focused application before hotkey,so i can't get his handle, so i can't send it a message with the char.
I want when i press the char, I want that these 2 application recive the char.
How CAN I do
|
|
|
|
|
troiszyzy wrote: so, I don't know activited/focused application before hotkey,so i can't get his handle
[DllImport("user32.dll", SetLastError = true)]
internal static extern IntPtr GetForegroundWindow();
private void myMethod()
{
IntPtr h = GetForegroundWindow();
string str = h.ToString();
}
|
|
|
|
|
|
|
Thank you my friend.
Freshman
|
|
|
|
|
Hello Friends
I want to make a windows application that can check any website rank according to the keyword on any of the search engines like Google, Yahoo, and MSN.
Can any one help me how can i start..
i got a link that is of web application i tried it to convert into C# windows application but i am unable to do that..
http://www.codeproject.com/KB/aspnet/search_engine_rank_check.aspx
|
|
|
|
|
I have a buffer object which is basically just an array of Int32s - is there an easy/fast way to write the whole buffer at once to disk in C#? Or, for that matter, to a SQL Server Blob?
|
|
|
|
|
Oops, I meant an array of UInt32
|
|
|
|
|
|
hi . i write application in .net1.1 and use crystal report.
application working in windows xp profetional correct but don't work in windows xp embedded please help me
|
|
|
|
|
Hi,
m using user control contains a grid
when cellvaluechanges event rais i want to rais an event in the form that have this user control,
how can i do that, i tryed set the grid to public but it didnt solve the problem ,
So any body can help me with it
|
|
|
|