using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string mystring = "server =75E3490002F4413 ; uid = sa; pwd = a418; database = tigerhrmis";
SqlConnection myconnection = new SqlConnection(mystring);
myconnection.Open();
string quarystring = "insert into 员工各项薪酬指标表(员工编号,基本工资,岗位工资,保密费,特殊津贴,绩效,个人社保额,等级薪酬编号) values('"+this.textBox1.Text+" ','"+this.textBox2.Text+"','"+this.textBox3.Text+"','"+this.textBox4.Text+"','"+this.textBox5.Text+"','"+this.textBox6.Text+"','"+this.textBox7.Text+"','"+this.textBox8.Text+"')";
SqlCommand mycommand = new SqlCommand(quarystring, myconnection);
myconnection.Close();
}
private void sqlConnection_InfoMessage(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs e)
{
}
private void textBox8_TextChanged(object sender, EventArgs e)
{
}
}
}
这是所有的,就这么点,但是老是找不出来原因,帮忙看一下,谢谢了!