Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
GeneralRe: Parse to double question Pin
JelleM29-May-06 12:42
JelleM29-May-06 12:42 
AnswerRe: Parse to double question Pin
Nader Elshehabi29-May-06 13:44
Nader Elshehabi29-May-06 13:44 
QuestionC# Late-binding with Delphi Question Pin
Andrew_Thomas29-May-06 11:34
Andrew_Thomas29-May-06 11:34 
JokeRe: C# Late-binding with Delphi Question Pin
Andrew_Thomas29-May-06 11:45
Andrew_Thomas29-May-06 11:45 
GeneralRe: C# Late-binding with Delphi Question Pin
leppie29-May-06 17:15
leppie29-May-06 17:15 
QuestionCan you use the VS.NET Designer for a TabPage? Pin
StevenS_Dev29-May-06 9:51
StevenS_Dev29-May-06 9:51 
AnswerRe: Can you use the VS.NET Designer for a TabPage? Pin
Rei Miyasaka29-May-06 10:53
Rei Miyasaka29-May-06 10:53 
GeneralRe: Can you use the VS.NET Designer for a TabPage? [modified] Pin
StevenS_Dev30-May-06 17:05
StevenS_Dev30-May-06 17:05 
QuestionSetting where Forms should show Pin
Tehshort29-May-06 9:24
Tehshort29-May-06 9:24 
AnswerRe: Setting where Forms should show [modified] Pin
Rei Miyasaka29-May-06 10:37
Rei Miyasaka29-May-06 10:37 
QuestionAdd node to TreeList Pin
Dima Filipiuk29-May-06 9:24
Dima Filipiuk29-May-06 9:24 
AnswerRe: Add node to TreeList Pin
leppie29-May-06 12:54
leppie29-May-06 12:54 
QuestionCan not use INSERT INTO for Date/Time Variable? Pin
surasaku29-May-06 8:57
surasaku29-May-06 8:57 
AnswerRe: Can not use INSERT INTO for Date/Time Variable? Pin
Christopher Duncan29-May-06 9:55
Christopher Duncan29-May-06 9:55 
AnswerRe: Can not use INSERT INTO for Date/Time Variable? Pin
Guffa29-May-06 10:01
Guffa29-May-06 10:01 
AnswerRe: Can not use INSERT INTO for Date/Time Variable? Pin
Guffa1-Jun-06 11:55
Guffa1-Jun-06 11:55 
surasaku wrote:
Hi Guffa,

Thanks for reply my message. I use Access database.Could you please see my code below? After debugging,the error message is "Syntax error in INSERT INTO Statement". Where is it wrong?

[Code]
string sql2;
string ContentUpdate = textBox2.Text;
DataView dv4 = new DataView(Dset.Tables["myData"]);
dv4.RowFilter = "Date =#"+dateselect+"#";
if (dv4.Count!=0)
sql2 = "UPDATE Content SET Content = '"+ContentUpdate+"' " +
"WHERE Date = #"+dateselect+"#";
else
sql2 = "INSERT INTO Content(Date) VALUES(#2006-05-30#)";
OleDbCommand cmd = new OleDbCommand();
OleDbTransaction trans;
try
{
conn.Open();
trans = conn.BeginTransaction();
cmd.Connection = conn;
cmd.CommandText = sql2;
cmd.Transaction = trans;
cmd.ExecuteNonQuery();
if(MessageBox.Show("Are you sure to Save data?","Data
Saving",MessageBoxButtons.OKCancel) == DialogResult.OK)
trans.Commit();
else
trans.Rollback();

}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
conn.Close();
}


Date is a reserved keyword. Change the field name, or if that is not possible, use brackets [] around the field name in the query.

---
b { font-weight: normal; }

QuestionUsing PathGradientBrush Pin
JuanAlbertoMD29-May-06 8:33
JuanAlbertoMD29-May-06 8:33 
QuestionHow to send e-mail Pin
ventomito29-May-06 7:39
ventomito29-May-06 7:39 
AnswerRe: How to send e-mail Pin
Guffa29-May-06 8:13
Guffa29-May-06 8:13 
GeneralRe: How to send e-mail Pin
ventomito29-May-06 8:31
ventomito29-May-06 8:31 
GeneralRe: How to send e-mail Pin
Christopher Duncan29-May-06 10:01
Christopher Duncan29-May-06 10:01 
QuestionClick event on a user control Pin
Ista29-May-06 7:07
Ista29-May-06 7:07 
QuestionCollision Detection Using Regions [modified] Pin
Tristan Rhodes29-May-06 7:02
Tristan Rhodes29-May-06 7:02 
Questionattach a database to sql Pin
shabonaa29-May-06 6:24
shabonaa29-May-06 6:24 
AnswerRe: attach a database to sql Pin
Colin Angus Mackay29-May-06 6:48
Colin Angus Mackay29-May-06 6:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.