zoukankan      html  css  js  c++  java
  • Winform中添加客户信息

    namespace JinXiaoCun
    {
        public partial class frmAddCustomer : Form
        {
            public frmAddCustomer()
            {
                InitializeComponent();
            }
    
            private void btnAddCustomer_Click(object sender, EventArgs e)
            {
                //insert into customer values('Cu01','陈工','男','13715687896')
                string cusId = this.txtCusId.Text.Trim();
                string cusName = this.txtCusName.Text.Trim();
                string cusSex = this.cmbCusSex.Text;
                string cusPhone = this.txtCusPhone.Text.Trim();
    
                string strsql = "insert into customer values('" + cusId + "','" + cusName + "','" + cusSex + "','" + cusPhone + "')";
                string conString = "Server=.;database=JinXiaoCun;uid=sa;pwd=sasa";
                SqlConnection con = new SqlConnection(conString);
                con.Open();
    
                SqlCommand cmd = new SqlCommand(strsql, con);
                cmd.ExecuteNonQuery();
    
                con.Close();
    
                this.txtCusId.Text = "";
                this.txtCusName.Text = "";
                this.cmbCusSex.Text = "";
                this.txtCusPhone.Text = "";
                MessageBox.Show("添加成功");
                
            }
        }
    }
  • 相关阅读:
    了解Javascript的函数调用和'this'
    js 实现简单收起功能
    页面跳转,form方式提交参数或数据
    查看图片大图效果
    2018phpstom 破解码
    JDK安装
    java 语法释义
    java的特性
    CSS(属性)
    CSS(层叠样式表概述)
  • 原文地址:https://www.cnblogs.com/Tianxf815/p/8869587.html
Copyright © 2011-2022 走看看