Setting a Text column in MySQLConnector .Net
Posted by: Robert Moffa
Date: April 07, 2010 07:27AM

I have several tables in which in need to store large text items--like web posts, etc. I have tried the following:

...
// The following creates a temp file containing the text..
string postfile = dbt.GetDBTextFile("This is Bob's post text for testing.");

Cmd.CommandText = "INSERT INTO Cust SET CustNo = 1004" +
", Post = LOAD_FILE('" + postfile + "');";
try
{
Cmd.ExecuteNonQuery();
Lbl_Error.Text = "DONE";

}
...

Using that code I always get the "Post cannot be Null" error message. The file is in my Temp file folder (used Path.GetTempFileName()) and contains the string. One thing I have noticed is that the temp file path is delimited by \\ instead of single backslashes.


Any suggestions?

Options: ReplyQuote


Subject
Written By
Posted
Setting a Text column in MySQLConnector .Net
April 07, 2010 07:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.