嗨,有人知道如何在绘制条形码时在底部也包含数字/字符串吗?
这是我的代码
private void btnGenerate_Click_1(object sender, EventArgs e)
{
Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum;
pictureBox1.Image = barcode.Draw(textBox1.Text, 50);
}
Run Code Online (Sandbox Code Playgroud)
PS我应该将它保存在数据库列中并在那里调用它吗?谢谢
VVatashi 先生回答的更新基础。这是新的输出。
谢谢
我正在制作一个表单,当该表单打开时,该表单中已经有一个ID显示.而且只是以打开的形式更新其列.但我的代码是将两个ID插入数据库.
这是我的代码.
private void btnAdd_Click(object sender, EventArgs e)
{
string insertSql =
"INSERT INTO Products(BrandName) OUTPUT INSERTED.ProductID VALUES(NULL)";
using (SqlConnection myConnection = new SqlConnection("Data Source=BENJOPC\\SQLEXPRESS;Initial Catalog=MARISCHELLdatabase;Integrated Security=True"))
{
myConnection.Open();
SqlCommand myCommand = new SqlCommand(insertSql, myConnection);
myCommand.ExecuteNonQuery();
Int32 newId = (Int32)myCommand.ExecuteScalar();
string aydi = newId.ToString();
myConnection.Close();
AddProducts ap = new AddProducts(aydi);
ap.FormClosing += new FormClosingEventHandler(this.AddProducts_FormClosing);
ap.ShowDialog();
pictureBox1.Image = null;
}
}
Run Code Online (Sandbox Code Playgroud)