|
In your delete query you have specified a parameter "@No" but you have not added that parameter to your SqlCeCommand object.
cmd.Parameters.AddWithValue("@No", Value);
Just replace Value with a variable that has the value of No that you want to delete.
|
|
|
|
|
Actually, "No" is the fieldname of the database, can i still use this approach to clear the database?
//---create the two tables---
SqlCeCommand cmd = new SqlCeCommand(
"CREATE TABLE LOCATION(No int " +
"identity(1,1) PRIMARY KEY, " +
"DateAndTime nvarchar(80)," +
"LocationInformation nvarchar(80))", conn);
cmd.ExecuteNonQuery();
codenoobie
|
|
|
|
|
OK basic SQL Language lesson, the command;
DELETE FROM LOCATION
Will clear ALL the data from the table LOCATION, if this is all you want to happen use the following SqlCeCommand code;
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "DELETE FROM LOCATION";
However the query you have in your code is;
DELETE FROM LOCATION WHERE No = @No
Take note of the "@No" value, this is a parameter that you need to supply a value for.
What this is saying is to delete the records from the LOCATION table where the No field is equal to the @No parameter. This is why the error message you are receiving is "SqlCeException was mishandled (A parameter is missing. [ Parameter ordinal = 1 ] )", this is telling you that you have not supplied a value for the first parameter in your query, which is "@No"
If you use;
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "DELETE from LOCATION where No = @No";
cmd.Parameters.AddWithValue("@No", Value);
This will only delete the records from the LOCATION table where the No field is equal to the value you supply for the @No parameter.
|
|
|
|
|
This is really really a late reply but I'm really grateful for your help, Thank you =)
|
|
|
|
|
Hi,
I have a html code dynamically generated from my server and i want to display it in windows form. inside any control which could do that. I don't want to implement the full web browser control. 'cause i am not going to display a browser but just the html output. What could be the options in C#?
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
The WebBrowser control is the only reasonable way to do it.
|
|
|
|
|
Thanks. i included the webbrowser control and it is appearing well as expected by making this property false. webBrowser1.AllowWebBrowserDrop = False
Now i have html code and i want to render that in the browser control instead of giving a url.
This html code is dynamically generated by me from my local system. ?
meanwhile i will try to find that out from msdn ....
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
yep. read the MSDN documentation on WebBrowser, discover the DocumentText property, and don't forget to disable some interactions through other properties if you want it for output only.
modified on Sunday, December 20, 2009 3:17 PM
|
|
|
|
|
Yes. Now i got it all into my program and it is working as expected.
My program connects to a server script through socket, gets the response and render it as html.
First i wrote it in C (WIN32 API) but displayed only as text. The size was 130kb and here it is just 20kb.
I guess object codes were totally compiled into a final exe for sdk and with respect to C# it should be cause of the framework which reduces the size like visual basic 6.0. I am new to c# just a few days back i started this . so was this question from a novice.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Very good.
It seems you successfully skipped "Hello World" then.
|
|
|
|
|
Hehe .. yes ... anyway thanks all for your replies. i have written a word reminder program and have published in my site which i want like wordweb.co.uk 's dictionary program.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Check my Code Project Article Scraping article[^]. I render HTML in a form.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
ok. i will examine your code to get more info so that will add more ideas.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
int? i = 7;
what does it mean?
what is actual application of nullable.
|
|
|
|
|
One typically would use a Nullable if the variable needs a "I don't know the value" state (similar to "null" for reference types). For some value types, you don't need all possible values and can use a special value, such as DateTime.MinValue; for others, all conceivable values could be meaningful and the "no value" state needs a separate something (which happens to be a hidden boolean in Nullable, so they are costing more memory and more cycles).
I'm not very fond of Nullable, one can easily do without them.
|
|
|
|
|
|
The other common scenario that Luc didn't mention is when interacting with databases that have nullable integer fields.
|
|
|
|
|
Is there any way to prevent the cursor changing to the resize cursor when the mouse is over the window border?
|
|
|
|
|
choose a windows type that isn't resizable!
|
|
|
|
|
Only resizable window types have glass borders when the titlebar is disabled.
|
|
|
|
|
I just need a simple application that can read <B> and <I> tags and simple html tables... Could you please direct me to an article?
Thank you.
|
|
|
|
|
|
Thanks for nothing. I already searched this site and on Google. I thought that maybe somebody has another parser I don't know of. Thanks for nothing. (again)
|
|
|
|
|
justme89 wrote: I already searched this site and on Google
You could have said that right away.
justme89 wrote: maybe somebody has another parser I don't know of.
I have lots of parsers you don't know of; I'm working on a whole new collection at this very instant. And I don't feel like making them available right now.
Bye.
|
|
|
|
|