Click here to Skip to main content
15,918,889 members
Home / Discussions / C#
   

C#

 
GeneralGetAttribute Returning Null Sometimes Pin
DemonBob1-Mar-05 10:37
DemonBob1-Mar-05 10:37 
GeneralRegex question Pin
ektoras1-Mar-05 10:02
ektoras1-Mar-05 10:02 
GeneralRe: Regex question Pin
Dave Kreskowiak1-Mar-05 10:18
mveDave Kreskowiak1-Mar-05 10:18 
GeneralRe: Regex question Pin
leppie1-Mar-05 11:10
leppie1-Mar-05 11:10 
GeneralOleDB Insert into MS Access Pin
Vodstok1-Mar-05 9:54
Vodstok1-Mar-05 9:54 
GeneralRe: OleDB Insert into MS Access Pin
Dave Kreskowiak1-Mar-05 10:16
mveDave Kreskowiak1-Mar-05 10:16 
GeneralRe: OleDB Insert into MS Access Pin
Vodstok1-Mar-05 10:26
Vodstok1-Mar-05 10:26 
GeneralRe: OleDB Insert into MS Access Pin
Anonymous1-Mar-05 10:42
Anonymous1-Mar-05 10:42 
Looking at your code I can't see why it doesnt work.

I do have a couple of suggestions that might help.

1. The OleDbDataAdapter is not required to execute a simple command it is only required when performing operations on datsets.
2. I would use parameters instead of hard coding the values into your command string, problems will occur if you have special characters in the varaiables such as quota marks. To do this the code will look something like below. (NOTE: You need to set the appropriate varaibale types for each parameter, I have guessed at what they might be)
3. I would recommend enclosing field names in square brackets as some words are reserved, see below.

string comma = "INSERT INTO comments([page],[who],[comment],[email]) VALUES (paramPage, paramName, paramComment, paramMail);"

OleDbConnection con = new OleDbConnection(strConn);
OleDbCommand cmd = new OleDbCommand(comma, con);

cmd.Parameters.Add("paramPage", OleDbType.Integer).Value = page;
cmd.Parameters.Add("paramName", OleDbType.VarWChar).Value = name;
cmd.Parameters.Add("paramComment", OleDbType.VarWChar).Value = comments;
cmd.Parameters.Add("paramMail", OleDbType.VarWChar).Value = mail;

con.Open();
cmd.ExecuteNonQuery();
con.Close();
GeneralRe: OleDB Insert into MS Access Pin
Troske1-Mar-05 12:29
Troske1-Mar-05 12:29 
GeneralProcess.HasExited problems Pin
3Dizard1-Mar-05 9:44
3Dizard1-Mar-05 9:44 
GeneralRe: Process.HasExited problems Pin
Dave Kreskowiak1-Mar-05 10:14
mveDave Kreskowiak1-Mar-05 10:14 
GeneralRe: Process.HasExited problems Pin
3Dizard2-Mar-05 23:10
3Dizard2-Mar-05 23:10 
GeneralRe: Process.HasExited problems Pin
3Dizard3-Mar-05 0:14
3Dizard3-Mar-05 0:14 
GeneralBasic Thread Questions Pin
GhostsOfOrion1-Mar-05 8:29
GhostsOfOrion1-Mar-05 8:29 
GeneralRe: Basic Thread Questions Pin
S. Senthil Kumar1-Mar-05 8:58
S. Senthil Kumar1-Mar-05 8:58 
GeneralRe: Basic Thread Questions (LONG) Pin
GhostsOfOrion1-Mar-05 16:00
GhostsOfOrion1-Mar-05 16:00 
GeneralRe: Basic Thread Questions (LONG) Pin
S. Senthil Kumar1-Mar-05 17:04
S. Senthil Kumar1-Mar-05 17:04 
GeneralRe: Basic Thread Questions (LONG) Pin
GhostsOfOrion2-Mar-05 4:17
GhostsOfOrion2-Mar-05 4:17 
GeneralInherited Forms in Compact Framework Pin
Tristan Rhodes1-Mar-05 7:59
Tristan Rhodes1-Mar-05 7:59 
GeneralOverriding Text in UserControl :confused: Pin
_eulogy_1-Mar-05 7:56
_eulogy_1-Mar-05 7:56 
GeneralRe: Overriding Text in UserControl :confused: Pin
spif20011-Mar-05 20:20
spif20011-Mar-05 20:20 
GeneralRe: Overriding Text in UserControl :confused: Pin
_eulogy_2-Mar-05 0:33
_eulogy_2-Mar-05 0:33 
GeneralForm Designer for Lightweight Framework Pin
Tristan Rhodes1-Mar-05 7:32
Tristan Rhodes1-Mar-05 7:32 
Generalupdating already opened window/form Pin
Adnan Siddiqi1-Mar-05 7:09
Adnan Siddiqi1-Mar-05 7:09 
GeneralExporting Crystal Reports To PDF Errors Pin
Khang Nguyen1-Mar-05 7:03
Khang Nguyen1-Mar-05 7:03 

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.