| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 656 人关注过本帖
标题:[原创]c#程序的一点问题
只看楼主 加入收藏
bobbyss
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-21
收藏
 问题点数:0 回复次数:4 
[原创]c#程序的一点问题

本人根同学一起写的一段关于库存管理中出库单的代码,可是提交不了,希望大家能指正一下:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace di1
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class 出库单 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label 名称;
private System.Windows.Forms.Label 编号;
private System.Windows.Forms.Label 类型;
private System.Windows.Forms.Label 颜色;
private System.Windows.Forms.Label outhouse;
private System.Windows.Forms.Label 日期;
private System.Windows.Forms.Label 送货单号;
private System.Windows.Forms.Label 领料人;
private System.Windows.Forms.Label 发生金额;
private System.Windows.Forms.Label 实际出库;
private System.Windows.Forms.Label 仓库名称;
private System.Windows.Forms.Label 单位;
private System.Windows.Forms.Label 单价;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox14;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox textBox15;
private System.Windows.Forms.TextBox textBox16;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.TextBox textBox17;
private System.Windows.Forms.TextBox textBox18;
private System.Windows.Forms.TextBox textBox19;
private System.Windows.Forms.TextBox textBox21;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox textBox22;
private System.Windows.Forms.TextBox textBox23;
private System.Windows.Forms.TextBox textBox25;
private System.Windows.Forms.TextBox textBox26;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.TabControl tab成品物料出库;
private System.Windows.Forms.TabPage tab成品;
private System.Windows.Forms.TabPage tab物料;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1;
private System.Data.OleDb.OleDbCommand oleDbSelectCommand1;
private System.Data.OleDb.OleDbCommand oleDbInsertCommand1;
private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1;
private System.Data.OleDb.OleDbCommand oleDbDeleteCommand1;
private System.Data.OleDb.OleDbConnection oleDbConnection1;
private System.Windows.Forms.Button 刷新1;
private System.Windows.Forms.Button fupdate;

private System.Windows.Forms.TextBox fdate;
private System.Windows.Forms.TextBox fperson;
private System.Windows.Forms.TextBox fname;
private System.Windows.Forms.TextBox fno;
private System.Windows.Forms.TextBox ftype;
private System.Windows.Forms.TextBox fcolor;
private System.Windows.Forms.TextBox fprice;
private System.Windows.Forms.TextBox funit;
private System.Windows.Forms.TextBox fcno;
private System.Windows.Forms.TextBox ftotal;
private System.Windows.Forms.TextBox fcost;
private System.Windows.Forms.TextBox fsno;
private System.Windows.Forms.Button 提交;
private System.Windows.Forms.Label 送货单号1;

/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public 出库单()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tab成品物料出库 = new System.Windows.Forms.TabControl();
this.tab成品 = new System.Windows.Forms.TabPage();
this.提交 = new System.Windows.Forms.Button();
this.fupdate = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.领料人 = new System.Windows.Forms.Label();
this.发生金额 = new System.Windows.Forms.Label();
this.实际出库 = new System.Windows.Forms.Label();
this.仓库名称 = new System.Windows.Forms.Label();
this.fdate = new System.Windows.Forms.TextBox();
this.单位 = new System.Windows.Forms.Label();
this.outhouse = new System.Windows.Forms.Label();
this.fsno = new System.Windows.Forms.TextBox();
this.fperson = new System.Windows.Forms.TextBox();
this.日期 = new System.Windows.Forms.Label();
this.名称 = new System.Windows.Forms.Label();
this.fname = new System.Windows.Forms.TextBox();
this.fno = new System.Windows.Forms.TextBox();
this.ftype = new System.Windows.Forms.TextBox();
this.fcolor = new System.Windows.Forms.TextBox();
this.fprice = new System.Windows.Forms.TextBox();
this.编号 = new System.Windows.Forms.Label();
this.类型 = new System.Windows.Forms.Label();
this.单价 = new System.Windows.Forms.Label();
this.颜色 = new System.Windows.Forms.Label();
this.funit = new System.Windows.Forms.TextBox();
this.fcno = new System.Windows.Forms.TextBox();
this.ftotal = new System.Windows.Forms.TextBox();
this.fcost = new System.Windows.Forms.TextBox();
this.tab物料 = new System.Windows.Forms.TabPage();
this.刷新1 = new System.Windows.Forms.Button();
this.textBox8 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.textBox14 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.textBox15 = new System.Windows.Forms.TextBox();
this.textBox16 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.textBox17 = new System.Windows.Forms.TextBox();
this.textBox18 = new System.Windows.Forms.TextBox();
this.textBox19 = new System.Windows.Forms.TextBox();
this.textBox21 = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.textBox22 = new System.Windows.Forms.TextBox();
this.textBox23 = new System.Windows.Forms.TextBox();
this.textBox25 = new System.Windows.Forms.TextBox();
this.textBox26 = new System.Windows.Forms.TextBox();
this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter();
this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand();
this.送货单号1 = new System.Windows.Forms.Label();
this.tab成品物料出库.SuspendLayout();
this.tab成品.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.tab物料.SuspendLayout();
this.SuspendLayout();
//
// tab成品物料出库
//
this.tab成品物料出库.Controls.Add(this.tab成品);
this.tab成品物料出库.Controls.Add(this.tab物料);
this.tab成品物料出库.Location = new System.Drawing.Point(0, 0);
this.tab成品物料出库.Name = "tab成品物料出库";
this.tab成品物料出库.SelectedIndex = 0;
this.tab成品物料出库.Size = new System.Drawing.Size(512, 464);
this.tab成品物料出库.TabIndex = 0;
//
// tab成品
//
this.tab成品.AutoScroll = true;
this.tab成品.Controls.Add(this.送货单号1);
this.tab成品.Controls.Add(this.提交);
this.tab成品.Controls.Add(this.fupdate);
this.tab成品.Controls.Add(this.dataGrid1);
this.tab成品.Controls.Add(this.领料人);
this.tab成品.Controls.Add(this.发生金额);
this.tab成品.Controls.Add(this.实际出库);
this.tab成品.Controls.Add(this.仓库名称);
this.tab成品.Controls.Add(this.fdate);
this.tab成品.Controls.Add(this.单位);
this.tab成品.Controls.Add(this.outhouse);
this.tab成品.Controls.Add(this.fsno);
this.tab成品.Controls.Add(this.fperson);
this.tab成品.Controls.Add(this.日期);
this.tab成品.Controls.Add(this.名称);
this.tab成品.Controls.Add(this.fname);
this.tab成品.Controls.Add(this.fno);
this.tab成品.Controls.Add(this.ftype);
this.tab成品.Controls.Add(this.fcolor);
this.tab成品.Controls.Add(this.fprice);
this.tab成品.Controls.Add(this.编号);
this.tab成品.Controls.Add(this.类型);
this.tab成品.Controls.Add(this.单价);
this.tab成品.Controls.Add(this.颜色);
this.tab成品.Controls.Add(this.funit);
this.tab成品.Controls.Add(this.fcno);
this.tab成品.Controls.Add(this.ftotal);
this.tab成品.Controls.Add(this.fcost);
this.tab成品.Location = new System.Drawing.Point(4, 21);
this.tab成品.Name = "tab成品";
this.tab成品.Size = new System.Drawing.Size(504, 439);
this.tab成品.TabIndex = 0;
this.tab成品.Text = "成品";
this.tab成品.Click += new System.EventHandler(this.tabPage1_Click);
//
// 提交
//
this.提交.Location = new System.Drawing.Point(360, 88);
this.提交.Name = "提交";
this.提交.Size = new System.Drawing.Size(88, 40);
this.提交.TabIndex = 59;
this.提交.Text = "提交";
this.提交.Click += new System.EventHandler(this.刷新_Click_1);
//
// fupdate
//
this.fupdate.Location = new System.Drawing.Point(360, 144);
this.fupdate.Name = "fupdate";
this.fupdate.Size = new System.Drawing.Size(88, 40);
this.fupdate.TabIndex = 57;
this.fupdate.Text = "刷新";
this.fupdate.Click += new System.EventHandler(this.刷新_Click);
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(8, 240);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(488, 192);
this.dataGrid1.TabIndex = 56;
this.dataGrid1.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dataGrid1_Navigate);
//
// 领料人
//
this.领料人.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.领料人.Location = new System.Drawing.Point(160, 192);
this.领料人.Name = "领料人";
this.领料人.Size = new System.Drawing.Size(64, 24);
this.领料人.TabIndex = 53;
this.领料人.Text = "领料人";
//
// 发生金额
//
this.发生金额.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.发生金额.Location = new System.Drawing.Point(160, 160);
this.发生金额.Name = "发生金额";
this.发生金额.Size = new System.Drawing.Size(64, 24);
this.发生金额.TabIndex = 52;
this.发生金额.Text = "发生金额";
//
// 实际出库
//
this.实际出库.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.实际出库.Location = new System.Drawing.Point(160, 128);
this.实际出库.Name = "实际出库";
this.实际出库.Size = new System.Drawing.Size(64, 24);
this.实际出库.TabIndex = 51;
this.实际出库.Text = "实际出库";
//
// 仓库名称
//
this.仓库名称.Font = new System.Drawing.Font("宋体", 10.5F,

未完待续

搜索更多相关主题的帖子: private public 
2006-06-21 01:47
bobbyss
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-21
收藏
得分:0 
[原创]c#程序的一点问题
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.仓库名称.Location = new System.Drawing.Point(160, 96);
this.仓库名称.Name = "仓库名称";
this.仓库名称.Size = new System.Drawing.Size(64, 24);
this.仓库名称.TabIndex = 49;
this.仓库名称.Text = "仓库名称";
//
// fdate
//
this.fdate.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fdate.Location = new System.Drawing.Point(360, 40);
this.fdate.Name = "fdate";
this.fdate.Size = new System.Drawing.Size(88, 23);
this.fdate.TabIndex = 48;
this.fdate.Text = "";
//
// 单位
//
this.单位.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.单位.Location = new System.Drawing.Point(8, 216);
this.单位.Name = "单位";
this.单位.Size = new System.Drawing.Size(40, 16);
this.单位.TabIndex = 47;
this.单位.Text = "单位";
//
// outhouse
//
this.outhouse.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.outhouse.Location = new System.Drawing.Point(176, 16);
this.outhouse.Name = "outhouse";
this.outhouse.Size = new System.Drawing.Size(120, 16);
this.outhouse.TabIndex = 46;
this.outhouse.Text = "成品出库单填写";
//
// fsno
//
this.fsno.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fsno.Location = new System.Drawing.Point(80, 40);
this.fsno.Name = "fsno";
this.fsno.Size = new System.Drawing.Size(56, 23);
this.fsno.TabIndex = 45;
this.fsno.Text = "";
//
// fperson
//
this.fperson.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fperson.Location = new System.Drawing.Point(232, 184);
this.fperson.Name = "fperson";
this.fperson.Size = new System.Drawing.Size(88, 23);
this.fperson.TabIndex = 44;
this.fperson.Text = "";
//
// 日期
//
this.日期.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.日期.Location = new System.Drawing.Point(320, 48);
this.日期.Name = "日期";
this.日期.Size = new System.Drawing.Size(48, 16);
this.日期.TabIndex = 43;
this.日期.Text = "日期";
//
// 名称
//
this.名称.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.名称.Location = new System.Drawing.Point(8, 96);
this.名称.Name = "名称";
this.名称.Size = new System.Drawing.Size(40, 16);
this.名称.TabIndex = 22;
this.名称.Text = "名称";
//
// fname
//
this.fname.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fname.Location = new System.Drawing.Point(48, 88);
this.fname.Name = "fname";
this.fname.Size = new System.Drawing.Size(88, 23);
this.fname.TabIndex = 27;
this.fname.Text = "";
//
// fno
//
this.fno.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fno.Location = new System.Drawing.Point(48, 112);
this.fno.Name = "fno";
this.fno.Size = new System.Drawing.Size(88, 23);
this.fno.TabIndex = 28;
this.fno.Text = "";
//
// ftype
//
this.ftype.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.ftype.Location = new System.Drawing.Point(48, 136);
this.ftype.Name = "ftype";
this.ftype.Size = new System.Drawing.Size(88, 23);
this.ftype.TabIndex = 29;
this.ftype.Text = "";
//
// fcolor
//
this.fcolor.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fcolor.Location = new System.Drawing.Point(48, 160);
this.fcolor.Name = "fcolor";
this.fcolor.Size = new System.Drawing.Size(88, 23);
this.fcolor.TabIndex = 30;
this.fcolor.Text = "";
//
// fprice
//
this.fprice.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fprice.Location = new System.Drawing.Point(48, 184);
this.fprice.Name = "fprice";
this.fprice.Size = new System.Drawing.Size(88, 23);
this.fprice.TabIndex = 31;
this.fprice.Text = "";
//
// 编号
//
this.编号.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.编号.Location = new System.Drawing.Point(8, 120);
this.编号.Name = "编号";
this.编号.Size = new System.Drawing.Size(40, 16);
this.编号.TabIndex = 23;
this.编号.Text = "编号";
//
// 类型
//
this.类型.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.类型.Location = new System.Drawing.Point(8, 144);
this.类型.Name = "类型";
this.类型.Size = new System.Drawing.Size(40, 16);
this.类型.TabIndex = 24;
this.类型.Text = "类型";
//
// 单价
//
this.单价.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.单价.Location = new System.Drawing.Point(8, 192);
this.单价.Name = "单价";
this.单价.Size = new System.Drawing.Size(40, 16);
this.单价.TabIndex = 25;
this.单价.Text = "单价";
//
// 颜色
//
this.颜色.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.颜色.Location = new System.Drawing.Point(8, 168);
this.颜色.Name = "颜色";
this.颜色.Size = new System.Drawing.Size(40, 16);
this.颜色.TabIndex = 26;
this.颜色.Text = "颜色";
//
// funit
//
this.funit.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.funit.Location = new System.Drawing.Point(48, 208);
this.funit.Name = "funit";
this.funit.Size = new System.Drawing.Size(88, 23);
this.funit.TabIndex = 36;
this.funit.Text = "";
//
// fcno
//
this.fcno.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fcno.Location = new System.Drawing.Point(232, 88);
this.fcno.Name = "fcno";
this.fcno.Size = new System.Drawing.Size(88, 23);
this.fcno.TabIndex = 37;
this.fcno.Text = "";
//
// ftotal
//
this.ftotal.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.ftotal.Location = new System.Drawing.Point(232, 120);
this.ftotal.Name = "ftotal";
this.ftotal.Size = new System.Drawing.Size(88, 23);
this.ftotal.TabIndex = 39;
this.ftotal.Text = "";
//
// fcost
//
this.fcost.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.fcost.Location = new System.Drawing.Point(232, 152);
this.fcost.Name = "fcost";
this.fcost.Size = new System.Drawing.Size(88, 23);
this.fcost.TabIndex = 40;
this.fcost.Text = "";
//
// tab物料
//
this.tab物料.Controls.Add(this.刷新1);
this.tab物料.Controls.Add(this.textBox8);
this.tab物料.Controls.Add(this.label3);
this.tab物料.Controls.Add(this.button2);
this.tab物料.Controls.Add(this.label7);
this.tab物料.Controls.Add(this.label8);
this.tab物料.Controls.Add(this.label9);
this.tab物料.Controls.Add(this.label11);
this.tab物料.Controls.Add(this.textBox14);
this.tab物料.Controls.Add(this.label12);
this.tab物料.Controls.Add(this.label13);
this.tab物料.Controls.Add(this.textBox15);
this.tab物料.Controls.Add(this.textBox16);
this.tab物料.Controls.Add(this.label14);
this.tab物料.Controls.Add(this.label15);
this.tab物料.Controls.Add(this.label16);
this.tab物料.Controls.Add(this.textBox17);
this.tab物料.Controls.Add(this.textBox18);
this.tab物料.Controls.Add(this.textBox19);
this.tab物料.Controls.Add(this.textBox21);
this.tab物料.Controls.Add(this.label17);
this.tab物料.Controls.Add(this.label18);
this.tab物料.Controls.Add(this.label19);
this.tab物料.Controls.Add(this.textBox22);
this.tab物料.Controls.Add(this.textBox23);
this.tab物料.Controls.Add(this.textBox25);
this.tab物料.Controls.Add(this.textBox26);
this.tab物料.Location = new System.Drawing.Point(4, 21);
this.tab物料.Name = "tab物料";
this.tab物料.Size = new System.Drawing.Size(504, 439);
this.tab物料.TabIndex = 1;
this.tab物料.Text = "物料";
this.tab物料.Click += new System.EventHandler(this.tabPage2_Click);
//
// 刷新1
//
this.刷新1.Location = new System.Drawing.Point(352, 152);
this.刷新1.Name = "刷新1";
this.刷新1.Size = new System.Drawing.Size(88, 48);
this.刷新1.TabIndex = 84;
this.刷新1.Text = "刷新";
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(40, 160);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(88, 21);
this.textBox8.TabIndex = 83;
this.textBox8.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(0, 168);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(32, 16);
this.label3.TabIndex = 82;
this.label3.Text = "颜色";
//
// button2
//
this.button2.Location = new System.Drawing.Point(352, 88);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(88, 48);
this.button2.TabIndex = 81;
this.button2.Text = "提交";
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label7.Location = new System.Drawing.Point(152, 200);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(64, 24);
this.label7.TabIndex = 80;
this.label7.Text = "领料人";
//
// label8
//
this.label8.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label8.Location = new System.Drawing.Point(152, 168);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(64, 24);
this.label8.TabIndex = 79;
this.label8.Text = "发生金额";
//
// label9
//
this.label9.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label9.Location = new System.Drawing.Point(152, 136);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(64, 24);
this.label9.TabIndex = 78;
this.label9.Text = "实际出库";
//
// label11
//
this.label11.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label11.Location = new System.Drawing.Point(152, 100);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(64, 24);
this.label11.TabIndex = 76;
this.label11.Text = "仓库名称";
//
// textBox14
//
this.textBox14.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox14.Location = new System.Drawing.Point(352, 48);
this.textBox14.Name = "textBox14";
this.textBox14.Size = new System.Drawing.Size(88, 23);
this.textBox14.TabIndex = 75;
this.textBox14.Text = "";
//
// label12
//
this.label12.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label12.Location = new System.Drawing.Point(0, 216);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(40, 16);
this.label12.TabIndex = 74;
this.label12.Text = "单位";
//
// label13
//
this.label13.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label13.Location = new System.Drawing.Point(184, 20);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(112, 16);
this.label13.TabIndex = 73;
this.label13.Text = "物料出库单填写";
//
2006-06-21 01:51
bobbyss
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-21
收藏
得分:0 
[原创]c#程序的一点问题
// textBox15
//
this.textBox15.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox15.Location = new System.Drawing.Point(72, 44);
this.textBox15.Name = "textBox15";
this.textBox15.Size = new System.Drawing.Size(56, 23);
this.textBox15.TabIndex = 72;
this.textBox15.Text = "";
//
// textBox16
//
this.textBox16.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox16.Location = new System.Drawing.Point(224, 192);
this.textBox16.Name = "textBox16";
this.textBox16.Size = new System.Drawing.Size(88, 23);
this.textBox16.TabIndex = 71;
this.textBox16.Text = "";
//
// label14
//
this.label14.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label14.Location = new System.Drawing.Point(312, 52);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(48, 16);
this.label14.TabIndex = 70;
this.label14.Text = "日期";
//
// label15
//
this.label15.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label15.Location = new System.Drawing.Point(0, 52);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(72, 16);
this.label15.TabIndex = 69;
this.label15.Text = "送货单号";
//
// label16
//
this.label16.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label16.Location = new System.Drawing.Point(0, 96);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(40, 16);
this.label16.TabIndex = 54;
this.label16.Text = "名称";
//
// textBox17
//
this.textBox17.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox17.Location = new System.Drawing.Point(40, 92);
this.textBox17.Name = "textBox17";
this.textBox17.Size = new System.Drawing.Size(88, 23);
this.textBox17.TabIndex = 59;
this.textBox17.Text = "";
//
// textBox18
//
this.textBox18.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox18.Location = new System.Drawing.Point(40, 116);
this.textBox18.Name = "textBox18";
this.textBox18.Size = new System.Drawing.Size(88, 23);
this.textBox18.TabIndex = 60;
this.textBox18.Text = "";
//
// textBox19
//
this.textBox19.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox19.Location = new System.Drawing.Point(40, 140);
this.textBox19.Name = "textBox19";
this.textBox19.Size = new System.Drawing.Size(88, 23);
this.textBox19.TabIndex = 61;
this.textBox19.Text = "";
//
// textBox21
//
this.textBox21.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox21.Location = new System.Drawing.Point(40, 184);
this.textBox21.Name = "textBox21";
this.textBox21.Size = new System.Drawing.Size(88, 23);
this.textBox21.TabIndex = 63;
this.textBox21.Text = "";
this.textBox21.TextChanged += new System.EventHandler(this.textBox21_TextChanged);
//
// label17
//
this.label17.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label17.Location = new System.Drawing.Point(0, 120);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(40, 16);
this.label17.TabIndex = 55;
this.label17.Text = "编号";
//
// label18
//
this.label18.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label18.Location = new System.Drawing.Point(0, 144);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(40, 16);
this.label18.TabIndex = 56;
this.label18.Text = "类型 ";
//
// label19
//
this.label19.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label19.Location = new System.Drawing.Point(0, 192);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(40, 16);
this.label19.TabIndex = 57;
this.label19.Text = "单价";
//
// textBox22
//
this.textBox22.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox22.Location = new System.Drawing.Point(40, 208);
this.textBox22.Name = "textBox22";
this.textBox22.Size = new System.Drawing.Size(88, 23);
this.textBox22.TabIndex = 64;
this.textBox22.Text = "";
//
// textBox23
//
this.textBox23.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox23.Location = new System.Drawing.Point(224, 92);
this.textBox23.Name = "textBox23";
this.textBox23.Size = new System.Drawing.Size(88, 23);
this.textBox23.TabIndex = 65;
this.textBox23.Text = "";
//
// textBox25
//
this.textBox25.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox25.Location = new System.Drawing.Point(224, 128);
this.textBox25.Name = "textBox25";
this.textBox25.Size = new System.Drawing.Size(88, 23);
this.textBox25.TabIndex = 67;
this.textBox25.Text = "";
//
// textBox26
//
this.textBox26.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.textBox26.Location = new System.Drawing.Point(224, 160);
this.textBox26.Name = "textBox26";
this.textBox26.Size = new System.Drawing.Size(88, 23);
this.textBox26.TabIndex = 68;
this.textBox26.Text = "";
//
// oleDbDataAdapter1
//
this.oleDbDataAdapter1.DeleteCommand = this.oleDbDeleteCommand1;
this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1;
this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "出库表1", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("编号", "编号"),
new System.Data.Common.DataColumnMapping("仓库名称", "仓库名称"),
new System.Data.Common.DataColumnMapping("单价", "单价"),
new System.Data.Common.DataColumnMapping("单位", "单位"),
new System.Data.Common.DataColumnMapping("发生金额", "发生金额"),
new System.Data.Common.DataColumnMapping("类型", "类型"),
new System.Data.Common.DataColumnMapping("领料人", "领料人"),
new System.Data.Common.DataColumnMapping("名称", "名称"),
new System.Data.Common.DataColumnMapping("日期", "日期"),
new System.Data.Common.DataColumnMapping("实际出库", "实际出库"),
new System.Data.Common.DataColumnMapping("送货单号", "送货单号"),
new System.Data.Common.DataColumnMapping("颜色", "颜色")})});
this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1;
//
// oleDbDeleteCommand1
//
this.oleDbDeleteCommand1.CommandText = @"DELETE FROM 出库表1 WHERE (编号 = ?) AND (仓库名称 = ? OR ? IS NULL AND 仓库名称 IS NULL) AND (单价 = ? OR ? IS NULL AND 单价 IS NULL) AND (单位 = ? OR ? IS NULL AND 单位 IS NULL) AND (发生金额 = ? OR ? IS NULL AND 发生金额 IS NULL) AND (名称 = ? OR ? IS NULL AND 名称 IS NULL) AND (实际出库 = ? OR ? IS NULL AND 实际出库 IS NULL) AND (日期 = ? OR ? IS NULL AND 日期 IS NULL) AND (类型 = ? OR ? IS NULL AND 类型 IS NULL) AND (送货单号 = ? OR ? IS NULL AND 送货单号 IS NULL) AND (领料人 = ? OR ? IS NULL AND 领料人 IS NULL) AND (颜色 = ? OR ? IS NULL AND 颜色 IS NULL)";
this.oleDbDeleteCommand1.Connection = this.oleDbConnection1;
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_编号", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "编号", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_仓库名称", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "仓库名称", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_仓库名称1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "仓库名称", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_单价", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "单价", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_单价1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "单价", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_单位", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "单位", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_单位1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "单位", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_发生金额", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "发生金额", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_发生金额1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "发生金额", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_名称", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "名称", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_名称1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "名称", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_实际出库", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "实际出库", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_实际出库1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "实际出库", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_日期", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "日期", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_日期1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "日期", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_类型", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "类型", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_类型1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "类型", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_送货单号", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "送货单号", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_送货单号1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "送货单号", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_领料人", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "领料人", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_领料人1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "领料人", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_颜色", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "颜色", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_颜色1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "颜色", System.Data.DataRowVersion.Original, null));
//
2006-06-21 01:51
bobbyss
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-21
收藏
得分:0 
[原创]c#程序的一点问题

// 送货单号1
//
this.送货单号1.Location = new System.Drawing.Point(8, 48);
this.送货单号1.Name = "送货单号1";
this.送货单号1.Size = new System.Drawing.Size(56, 16);
this.送货单号1.TabIndex = 60;
this.送货单号1.Text = "送货单号";

//
// 出库单
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(520, 494);
this.Controls.Add(this.tab成品物料出库);
this.MaximizeBox = false;
this.Name = "出库单";
this.Text = "出库单";
this.Load += new System.EventHandler(this.出库单_Load);
this.tab成品物料出库.ResumeLayout(false);
this.tab成品.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.tab物料.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new 出库单());
}

private void tabPage1_Click(object sender, System.EventArgs e)
{

}

private void textBox21_TextChanged(object sender, System.EventArgs e)
{

}

private void tabPage2_Click(object sender, System.EventArgs e)
{

}

private void 出库单_Load(object sender, System.EventArgs e)
{
OleDbConnection conn=new OleDbConnection();
conn.ConnectionString =" Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =\"db1.mdb\" " ;
string selectStr = "SELECT * FROM 出库表1";
OleDbCommand myCommand=new OleDbCommand();
conn.Open();
myCommand.Connection=conn;
myCommand.CommandText=selectStr;
OleDbDataAdapter myAdapter = new OleDbDataAdapter();
myAdapter.SelectCommand=myCommand;
DataSet myDataSet=new DataSet();
myAdapter.Fill(myDataSet,"出库表1");
dataGrid1.SetDataBinding(myDataSet,"出库表1");
}

2006-06-21 01:55
bobbyss
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-6-21
收藏
得分:0 
[原创]c#程序的一点问题
private void dataGrid1_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
{

}

private void 刷新_Click(object sender, System.EventArgs e)
{
OleDbConnection conn=new OleDbConnection();
conn.ConnectionString =" Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =\"db1.mdb\" " ;
string selectStr = "SELECT * FROM 出库表1";
OleDbCommand myCommand=new OleDbCommand();
conn.Open();
myCommand.Connection=conn;
myCommand.CommandText=selectStr;
OleDbDataAdapter myAdapter = new OleDbDataAdapter();
myAdapter.SelectCommand=myCommand;
DataSet myDataSet=new DataSet();
myAdapter.Fill(myDataSet,"出库表1");
dataGrid1.SetDataBinding(myDataSet,"出库表1");
}

private void 提交_Click_1(object sender, System.EventArgs e)
{
try
{
if(送货单号.Text!=""&&日期.Text!=""&&名称.Text!=""&&编号.Text!=""&&颜色.Text!=""&&类型.Text!=""&&单位.Text!=""&&单价.Text!=""&&仓库名称.Text!=""&&实际出库.Text!=""&&领料人.Text!="")
{

OleDbConnection Conn=new OleDbConnection();
Conn.ConnectionString= " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =\"db1.mdb\" " ;
Conn.Open();
OleDbCommand Comm=new OleDbCommand();
Comm.Connection=Conn;
Comm.CommandText="INSERT INTO 出库表1(送货单号, 日期,名称,编号,颜色,类型,单位,单价,仓库名称,实际出库,领料人) VALUES ('";
Comm.CommandText+=送货单号.Text+"','";
Comm.CommandText+=日期.Text+"','";
Comm.CommandText+=名称.Text+"','";
Comm.CommandText+=编号.Text+"','";
Comm.CommandText+=颜色.Text+"','";
Comm.CommandText+=类型.Text+"','";
Comm.CommandText+=单位.Text+"','";
Comm.CommandText+=单价.Text+"','";
Comm.CommandText+=仓库名称.Text+"','";
Comm.CommandText+=实际出库.Text+"','";
Comm.CommandText+=领料人.Text+"')";
Comm.ExecuteNonQuery();
Conn.Close();
}
else
{
MessageBox.Show("提交成功","错误");
}
}
catch(Exception error)
{
MessageBox.Show("提交未成功"+error.ToString(),"错误");
}
}

private void 刷新_Click_1(object sender, System.EventArgs e)
{
try
{
if(送货单号.Text!=""&&日期.Text!=""&&名称.Text!=""&&编号.Text!=""&&颜色.Text!=""&&类型.Text!=""&&单位.Text!=""&&单价.Text!=""&&仓库名称.Text!=""&&实际出库.Text!=""&&领料人.Text!="")
{

OleDbConnection Conn=new OleDbConnection();
Conn.ConnectionString= " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =\"db1.mdb\" " ;
Conn.Open();
OleDbCommand Comm=new OleDbCommand();
Comm.Connection=Conn;
Comm.CommandText="INSERT INTO 出库表1(送货单号, 日期,名称,编号,颜色,类型,单位,单价,仓库名称,实际出库,领料人) VALUES ('";
Comm.CommandText+=送货单号.Text+"','";
Comm.CommandText+=日期.Text+"','";
Comm.CommandText+=名称.Text+"','";
Comm.CommandText+=编号.Text+"','";
Comm.CommandText+=颜色.Text+"','";
Comm.CommandText+=类型.Text+"','";
Comm.CommandText+=单位.Text+"','";
Comm.CommandText+=单价.Text+"','";
Comm.CommandText+=仓库名称.Text+"','";
Comm.CommandText+=实际出库.Text+"','";
Comm.CommandText+=领料人.Text+"')";
Comm.ExecuteNonQuery();
Conn.Close();
}
else
{
MessageBox.Show("提交成功","错误");
}
}
catch(Exception error)
{
MessageBox.Show("提交未成功"+error.ToString(),"错误");
}
}


}
}
可能有点长,而且还有其他很多问题,因为我们都是初学者,希望大家不吝指教,谢谢!!!

2006-06-21 01:57
快速回复:[原创]c#程序的一点问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038806 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved