Hi to everybody,
first here is my code
<pre> private void GetButtonsTextFile(object sender, EventArgs e)
{
controlName = ((Control)(sender)).Name;
parentName = ((Control)(sender)).Parent.Name;
controlLocation = ((Control)(sender)).Location;
parentLocation = ((Control)(sender)).Parent.Location;
datastring = controlName + ";" + parentName + ";" + DateTime.Now.ToString() + ";" + memberID + ";" + controlLocation + ";" + parentLocation;
using (System.IO.StreamWriter file = new System.IO.StreamWriter(filepath, true))
{
try
{
file.WriteLine(datastring);
}
catch (System.IO.IOException ex)
{
MessageBox.Show(ex.ToString());
}
}
}
Im writing some parameter of the object which calls the Methode GetButtonsTextFile() to a TextFile. This works fine.
Now i want to transfer the content of the textfile to the colums of the table of my mysql database. All types are string. Only the columns for buttonLocation and parentLocation are from the type point (See comments).
I transfer the content of the textfile with this mehtode:
public void SendFileToDatabase()
{
try
{
OdbcConnection dbConnection = new OdbcConnection(connectionstring);
dbConnection.Open();
loadTxtToTable = "LOAD DATA LOCAL INFILE '" + filepath + "' INTO TABLE " + table + " FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n'";
OdbcCommand LoadFileToTable = new OdbcCommand(loadTxtToTable, dbConnenction);
LoadFileToTable.ExecuteNonQuery();
dbConnection.Close();
}
catch (System.Data.Odbc.OdbcException ex)
{
MessageBox.Show(ex.ToString());
}
}
Without the point paramters the tranfer works fine, but if i try to transfer the point paramters to the desired fields it doesnt work.
The exeption says: cannot get geometry object from data you send to the Geometry Field
I could make them as string but i need them as point objects because later i want to display them as points in a chart. Or is there a way to display string points from a field to a chart?
Does somebody has a suggestion?
Appreciate.. Thanks a lot
What I have tried:
looking for similar artices, msdn, google