どのようにデータを運ぶかは、データを保存した後でもデータを保存しようとしているため、 」出てくると、その同じ形データベースに情報を保存した後にデータを運ぶ
private void button1_Click(object sender, EventArgs e)
{
{
try
{
connect.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connect;
command.CommandText = "insert into RegisterItem([Name], [Url],[Description], [Price]) values('" + ItemName.Text + "','" + ItemUrl.Text + "','" + ItemDescription.Text + "','" + ItemPrice.Text + "')";
command.ExecuteNonQuery();
MessageBox.Show("Data Saved");
txtUsername = txtID1;
ItemName = txtName1;
ItemDescription = txtDescription1;
ItemPrice = txtPrice1;
ItemName.Text = "";
ItemDescription.Text = "";
ItemPrice.Text = "";
connect.Close();
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex);
connect.Close();
}
string str = ItemUrl.Text;
pictureBox1.ImageLocation = str;
//string str = textBox1.Text;
// Image img = Image.FromFile(str);
// pictureBox1.Image = img;
}
}
「キャリーデータ」とはどういう意味ですか? – Kinetic
はtextbox = textboxと同じですが、ボタンの下またはボタンの上に置いても私には許されません。command.ExecuteNonQuery();私は他の方法を見つけることができませんでした –
私は本当にあなたが言っていることを理解していません。あなたは答えを明確にする方法を見つけなければなりません。 "textbox = textboxのように"は私には意味がありません。 – Kinetic