M
Manuel Adam
Hello everyone!
I am using a StoredProcedure with Microsoft Access.
COMMAND.Connection = CON;
COMMAND.CommandText="[new Entry]";
COMMAND.CommandType = System.Data.CommandType.StoredProcedure;
COMMAND.Parameters.Add("@Field1",OleDbType.Guid).Value = new
System.Guid(Cookie1.Value);
COMMAND.Parameters.Add("@Field2",OleDbType.Guid).Value = new
System.Guid(Cookie2.Value);
COMMAND.Parameters.Add("@Field3",OleDbType.VarChar,255).Value =
Textbox1.Text;
// Memo field that shouldn't be NULL
COMMAND.Parameters.Add("@Field4",OleDbType.VarChar,4000).Value =
Textbox2.Text;
if(this.Textbox3.Text.Length==0) // MEMO field that can be NULL.
COMMAND.Parameters.Add("@Field5",OleDbType.VarChar,4000).Value =
String.Empty;
// null won't work either.
int temp = COMMAND.ExecuteNonQuery(); // Exception ->>
System.Data.OleDb.OleDbException: Parameter[@Field5] has no default value.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
Do anyone know a solution for this?
Manuel
_no_spam * not belongs to the email address.
Only reply to Newsgroup.
I am using a StoredProcedure with Microsoft Access.
COMMAND.Connection = CON;
COMMAND.CommandText="[new Entry]";
COMMAND.CommandType = System.Data.CommandType.StoredProcedure;
COMMAND.Parameters.Add("@Field1",OleDbType.Guid).Value = new
System.Guid(Cookie1.Value);
COMMAND.Parameters.Add("@Field2",OleDbType.Guid).Value = new
System.Guid(Cookie2.Value);
COMMAND.Parameters.Add("@Field3",OleDbType.VarChar,255).Value =
Textbox1.Text;
// Memo field that shouldn't be NULL
COMMAND.Parameters.Add("@Field4",OleDbType.VarChar,4000).Value =
Textbox2.Text;
if(this.Textbox3.Text.Length==0) // MEMO field that can be NULL.
COMMAND.Parameters.Add("@Field5",OleDbType.VarChar,4000).Value =
String.Empty;
// null won't work either.
int temp = COMMAND.ExecuteNonQuery(); // Exception ->>
System.Data.OleDb.OleDbException: Parameter[@Field5] has no default value.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
Do anyone know a solution for this?
Manuel
_no_spam * not belongs to the email address.
Only reply to Newsgroup.