C# 将文本另存为Access和C的超链接样式#
上面的命令将在文本框(txt\U图像)上创建一个图像路径 单击〖保存〗按钮,命令如下:C# 将文本另存为Access和C的超链接样式#,c#,ms-access,C#,Ms Access,上面的命令将在文本框(txt\U图像)上创建一个图像路径 单击〖保存〗按钮,命令如下: private void button1_Click(objectsender, EventArgs e) { OpenFileDialogdlg = newOpenFileDialog(); dlg.Filter = "JPGFiles(*.jpg)|*.jpg|PNG Files(*.png)|*.png|All Files(*.*)|*.*";
private void button1_Click(objectsender, EventArgs e)
{
OpenFileDialogdlg = newOpenFileDialog();
dlg.Filter = "JPGFiles(*.jpg)|*.jpg|PNG Files(*.png)|*.png|All Files(*.*)|*.*";
if(dlg.ShowDialog() == DialogResult.OK)
{
stringpicLoc = dlg.FileName.ToString();
txt_image.Text = picLoc;
pictureBox1.ImageLocation = picLoc;
}
}
}
然后出现一个错误,说明“条件表达式中的数据类型不匹配”,因为MS Access中的“图片”列设置是Hyperlink
我不确定如何将数据作为超链接而不是文本插入。可能重复的可能重复的
command.CommandText = "insert into RecordsSheet ([Picture]) values('" + txt_image.Text + "')";