문자열을 통과 한 데이터가 저장된 후 오류가 표시됩니다. 지정된 경로 형식이 지원되지 않습니다. 잘못된 것이거나 url
변환기 코드를 넣었습니다. 잘못된 장소?오류 System.NotSupportedException : 지정된 경로의 형식이 지원되지 않습니다.
try
{
connect.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connect;
command.CommandText = string.Format("insert into RegisterItem([Name], [Url],[Description], [Price]) values('{0}','{1}','{2}','{3}')",
ItemName.Text,
ItemUrl.Text,
ItemDescription.Text,
ItemPrice.Text);
command.ExecuteNonQuery();
MessageBox.Show("Data Saved");
txtID1.Text = txtUsername.Text;
txtName1.Text = ItemName.Text;
txtDescription1.Text = ItemDescription.Text;
txtPrice1.Text = ItemPrice.Text;
ItemName.Text = "";
ItemDescription.Text = "";
ItemPrice.Text = "";
string str = ItemUrl.Text;
pictureBox1.ImageLocation = str;
string str1 = textBox1.Text;
Image img = Image.FromFile(str);
pictureBox1.Image = img;
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex);
}
finally
{
if (Connect != null) { connect.Close(); }
}
'ItemUrl'에 무엇이 있습니까? 우리는 당신의 컴퓨터를 볼 수 없습니다 :) – Pikoh
그것은 텍스트 상자입니다, 당신이 그림을 입력 할 것입니다. pictureBox1에 –
하지만 예외를 일으키는 'ItemUrl.Text' 값은 무엇입니까? – slawekwin