1
我的DataGridView
中的第五列是從我們的SQL服務器中的resumelink
中提取信息。文件的名稱是resumelink記錄中的唯一內容,例如。 DOC100.pdf或Name12.pdf。我需要那些鏈接到計算機上的映射驅動器,所以,如果文件的名稱是DOC100.pdf,它需要是//nt/resume/DOC100.pdf
。我需要存儲//nt/resume
部分,然後添加resumelink字段中的內容。我有一個名爲dataGridView1_CellContentClick
的字段,但它目前是空的。我不關心pdf是如何打開的,無論是在IE還是Adobe。使用Datagridview,獲取現有列並使其成爲超鏈接
下面是一張關於程序外觀的圖片。
namespace ResumeTest
{
public partial class Resume : Form
{
SqlConnection conn = new SqlConnection();
public Resume()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'iHBAPPSDataSet.HRresume' table. You can move, or remove it, as needed.
this.hRresumeTableAdapter.Fill(this.iHBAPPSDataSet.HRresume);
this.dataGridView1.RowsDefaultCellStyle.BackColor = Color.White;
this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine;
}
private void button1_Click(object sender, EventArgs e)
{
bindingSource1.Filter = "name LIKE '%" + name.Text + "%' AND skillset LIKE '%" + skillset.Text + "%'";
}
public void ClearTextBoxes(Control control)
{
foreach (Control c in control.Controls)
{
if (c is TextBox)
{
if (!(c.Parent is NumericUpDown))
{
((TextBox)c).Clear();
}
}
else if (c is NumericUpDown)
{
((NumericUpDown)c).Value = 0;
}
else if (c is ComboBox)
{
((ComboBox)c).SelectedIndex = 0;
}
if (c.HasChildren)
{
ClearTextBoxes(c);
}
}
}
private void button2_Click(object sender, EventArgs e)
{
ClearTextBoxes(this);
bindingSource1.Filter = "name LIKE '%" + name.Text + "%'";
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void button4_Click(object sender, EventArgs e)
{
Add f2 = new Add();
f2.Show();
}
private void button6_Click(object sender, EventArgs e)
{
Delete f3 = new Delete();
f3.Show();
}
private void refreshButton_Click(object sender, EventArgs e)
{
this.hRresumeTableAdapter.Fill(this.iHBAPPSDataSet.HRresume);
}
private void quitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
爲什麼不返回''// nt/resume /'+ resumelink從sql server本身作爲resumelink'? – 2013-03-27 19:40:47