还是解决不了,字段比较多
string ConnString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionSql"];
//从<AppSettings>节读取连接字符串
SqlConnection sqlcon = new SqlConnection(ConnString);
//创建SqlConnection对象
sqlcon.Open();
string sqlinsert="insert into jmxx values('txthkno.Text.ToString()','txtid.Text.ToString()',"
+"'txtbno.Text.ToString()','txthno.Text.ToString()',"
+"'Drophktype.SelectedItem.Value ',"
+"'txtname.Text.ToString()',"
+"'txttel.Text.ToString()',"
+"'txtaddress.Text.ToString()',"
+"'Convert.ToInt32(txtcount.Text)',"
+"'Convert.ToInt32(txtmancount.Text)',"
+"'Convert.ToInt32(txtwomancount.Text)',"
+"'Convert.ToInt32(txtincome.Text)',"
+"'Dropeconomy.SelectedItem.Value',"
+"'Drophousetype.SelectedItem.Value',"
+"'txtfamilynote.Text.ToString()',"
+"'txtname.Text.ToString()',"
+"'txtprename.Text.ToString()',"
+"'Droprelation.SelectedItem.Value',"
+"'txtcardid.Text.ToString()',"
+"'txtsign.Text.ToString()',"
//+"'Convert.ToDateTime(txtsigndate.Text)',"
+"' DateTime.Parse(txtsigndate.Text)',"日期类型的
+"' DateTime.Parse(txtbirth.Text)',"日期类型的
//+"'Convert.ToDateTime((TextBox)(txtbirth.Text))',"
+"'txtbirthplace.Text.ToString()',"
+"'Dropsex.SelectedItem.Value',"
+"'Convert.ToInt32(txthigh.Text)',"
+"'Dropbloodtype.SelectedItem.Value',"
+"'Dropnation.SelectedItem.Value',"
+"'txthkplace.Text.ToString()',"
+"'txtjg.Text.ToString()',"
+"'Dropschool.SelectedItem.Value',"
+"'Dropmarry.SelectedItem.Value',"
+"'Droppolitical.SelectedItem.Value',"
+"'txtwork.Text.ToString()',"
+"'Dropmilitary.SelectedItem.Value',"
+"'TextBoxtel.Text.ToString()',"
+"'TextBoxnote.Text.ToString()',"
//+"'Convert.ToDateTime(txtintime.Text)',"
+"' DateTime.Parse(txtintime.Text)',"日期类型的
+"'txtpre.Text.ToString()',"
+"'txtinreason.Text.ToString()',"
+"' DateTime.Parse(txtouttime.Text)',"日期类型的
//+"'Convert.ToDateTime(txtouttime.Text)',"
+"'txtout.Text.ToString()','txtoutreason.Text.ToString()')";
SqlCommand comm = new SqlCommand(sqlinsert,sqlcon);
comm.ExecuteNonQuery();
sqlcon.Close();
Response.Redirect("admin.aspx");