Click here to Skip to main content
16,018,294 members

Comments by Member 10284036 (Top 11 by date)

Member 10284036 15-Nov-14 4:18am View    
Thank you very much, I hope it will work (I sent it to the stuff of my domain hoping it will be accepted) KR MiKr41
Member 10284036 14-Nov-14 7:03am View    
Additionally I tried an insert without blob data using the same code remaining after deleting ?rawData - this work's perfectly fine.
Member 10284036 14-Nov-14 6:30am View    
Thank you for your answer - but still I have this damned timeout error. The Insert command look's like:
<pre?cs>
public byte[] ImageToByteArray(string fileName)
{
byte[] rawData = File.ReadAllBytes(fileName);
FileInfo info = new FileInfo(fileName);
int fileSize = Convert.ToInt32(info.Length);
using (MySqlCommand command = new MySqlCommand())
{
command.Connection = DBC;
command.CommandText = "insert into pat_picture_old (Patient_ID, Datei, BildDaten, DatenLen) values (233, ?fileName, ?rawData, ?fileSize)";
(file_name, file_size, file) VALUES (?fileName, ?fileSize, ?rawData)";
MySqlParameter fileNameParameter = new MySqlParameter("?fileName", MySqlDbType.VarChar, 50);
MySqlParameter fileSizeParameter = new MySqlParameter("?fileSize", MySqlDbType.Int32);
MySqlParameter fileContentParameter = new MySqlParameter("?rawData", MySqlDbType.Blob, rawData.Length);
fileNameParameter.Value = fileName;
fileSizeParameter.Value = fileSize;
fileContentParameter.Value = rawData;
command.Parameters.Add(fileNameParameter);
command.Parameters.Add(fileSizeParameter);
command.Parameters.Add(fileContentParameter);
try
{
command.ExecuteNonQuery();
}
catch (MySqlException mEX)
{
MessageBox.Show(mEX.Message);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
return rawData;
}
</pre>
Member 10284036 6-Feb-14 13:50pm View    
Dear G-code 101 - I found it. First I wrote a small program calling the questioned DLL - everything worked fine. Next step: call the calling dll, do the click on btn_new there was a missing dll announced (in the references it was still there!) I removed the dll and bound it again, doing the same in the main program the error is gone. This means, everytime you are changing a frequently used dll you would have to remove all references and bind it again to all program parts!?
Thank you for your advice
MiKr41
Member 10284036 6-Feb-14 5:15am View    
There are a lot of different buttons defined, a selection is shown:
//
// grafikButton
//
this.grafikButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.grafikButton.Location = new System.Drawing.Point(216, 336);
this.grafikButton.Name = "grafikButton";
this.grafikButton.Size = new System.Drawing.Size(88, 24);
this.grafikButton.TabIndex = 7;
this.grafikButton.Text = "&Grafik";
this.grafikButton.Click += new System.EventHandler(this.grafikButton_Click);
//
// btn_New
//
this.btn_New.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_New.Location = new System.Drawing.Point(320, 336);
this.btn_New.Name = "btn_New";
this.btn_New.Size = new System.Drawing.Size(88, 24);
this.btn_New.TabIndex = 9;
this.btn_New.Text = "N&eu";
this.btn_New.Click += new System.EventHandler(this.btn_New_Click);
//
// btn_NewList
//
this.btn_NewList.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_NewList.Location = new System.Drawing.Point(320, 368);
this.btn_NewList.Name = "btn_NewList";
this.btn_NewList.Size = new System.Drawing.Size(88, 24);
this.btn_NewList.TabIndex = 10;
this.btn_NewList.Text = "Neu (&Liste)";
this.mainTip.SetToolTip(this.btn_NewList, "Es erfolgt eine Auswahl der definierten Listen, die ein Fenster mit den Eingabefe" +
"ldern erzeugen.");
this.btn_NewList.Click += new System.EventHandler(this.btn_NewList_Click);

The problem is, that every button is acting as it should but only two - the btn_New and the btn_NewList shows this strange behaviour.

The whole Coding of the response to the Click is as follows:
private void btn_New_Click(object sender, System.EventArgs e)
{
isNew = true;
Console.WriteLine(isNew);
isNewListe = false;
inputDatum = dt.Heute();
inputTime = dt.Jetzt();
editBox.Visible = false;
ergEdit.Visible = false;
zeitEdit.Visible = false;
editBox.Items.Clear();
laborListe.Visible = false;
overViewListe.Visible = false;
laborListe.Items.Clear();
nextButton.Visible = false;
prevButton.Visible = false;
overViewButton.Visible = false;
printButton.Visible = false;
grafikButton.Visible = false;
copyButton.Visible = false;
btn_New.Visible = false;
btn_NewList.Visible = false;
editButton.Text = "Weiter";
deleteButton.Text = "Sichern";
deleteButton.Visible = false;
panelSingel.Visible = true;
cancelButton.Visible = true;
grpBox.Items.Clear();
MySqlDataAdapter DBPar = new MySqlDataAdapter("select distinct Gruppe from laborparameter order by Gruppe", DBC);
DataSet sPar = new DataSet();
if (DBPar.Fill(sPar) > 0)
{
foreach(DataRow dr in sPar.Tables[0].Rows)
{
grpBox.Items.Add(dr["Gruppe"].ToString().TrimEnd(' '));
}
}
if (grpBox.Items.Count > 0)
{
grpBox.SelectedIndex = 0;
}
}

The environment: this dll is embedded in a calling dll which too is called by the main program. The whole package consists of about 70 dll's. This is the f