Visual Studio .net with Foxpro 8.0

  • Thread starter Thread starter Sundar G
  • Start date Start date
S

Sundar G

Hi All,

I am using Visual C# as the Front End and Visual
Foxpro 8.0 as the Back End. There is a memo field in the
Foxpro 8.0 table. I am trying to insert it from the
asp.net page. But when the length of the string which is
going to be inserted into the memo field is large, i am
not able to insert it. Its throwing an error saying
"Command contains unrecognized phrase/keyword". When the
size of the string is reduced, it gets inserted. What is
the way by which i will be able to insert it even if the
length of the string is large.

Thanx in Advance

Sundar G
 
Sundar G said:
I am using Visual C# as the Front End and Visual
Foxpro 8.0 as the Back End. There is a memo field in the
Foxpro 8.0 table. I am trying to insert it from the
asp.net page. But when the length of the string which is
going to be inserted into the memo field is large, i am
not able to insert it. Its throwing an error saying
"Command contains unrecognized phrase/keyword". When the
size of the string is reduced, it gets inserted. What is
the way by which i will be able to insert it even if the
length of the string is large.

Are you using a parameter? This is the best way to insert memo fields.

Something like this (VB.Net):

cmd.CommandText = "UPDATE " & tablename & " SET " & memoFieldName & "=?
WHERE id='" + idval + "'"
Dim P As New OleDb.OleDbParameter("@memoContent", OleDb.OleDbType.BSTR,
sValue.Length, ParameterDirection.Input, False, 0, 0, Nothing,
DataRowVersion.Current, sValue)

cmd.Parameters.Add(P)

cmd.ExecuteNonQuery()

cmd.Parameters.Clear()

Tim
Investigating .Net:
http://www.itwriting.com/dotnet1.php
 
Back
Top