private SQLHelper sqlhelper;
public Form1()
{
InitializeComponent();
sqlhelper = new SQLHelper();
}
string sql = "insert testtxtIn1(wellname,x,y,z,h) values(@wellname,@x,@y,@z,@h)";
SqlParameter[] paras = new SqlParameter[]
{
new SqlParameter("@wellname",tabhead[0]),
new SqlParameter("@x",Convert.ToDecimal(tabhead[1])),
new SqlParameter("@y",Convert.ToDecimal(tabhead[2])),
new SqlParameter("@z",Convert.ToDecimal(tabhead[3])),
new SqlParameter("@h",Convert.ToDecimal(tabhead[4]))
// new SqlParameter("@x",tabhead[1]),
//new SqlParameter("@y",tabhead[2]),
//new SqlParameter("@z",tabhead[3]),
//new SqlParameter("@h",tabhead[4])
};
sqlhelper.ExecuteNonQuery(sql, paras, CommandType.Text);