每次點擊注冊時,它提示我錯誤。我檢查不出來有啥錯的。以下是我單擊注冊按鈕的代碼 protected void Button4_Click(object sender, EventArgs e)
{
string usersex =" ";
if (RadioButton3.Checked ==true )
usersex = "男";
else
usersex = "女";
string connString = System.Configuration.ConfigurationManager.ConnectionStrings["yhzlConnectionString"].ConnectionString;
SqlConnection myConn = new SqlConnection(connString);
string sqlStr = " insert into 用戶資料(用戶名,密碼,權限,性別,地址) values('" + txtzcName.Text.ToString() + "','" + txtzcPasswork.Text.ToString() + "','" + 0 + "','" + usersex + "','" + txtadd.Text.ToString() + "') ";
SqlCommand myCmd = new SqlCommand(sqlStr, myConn);
myConn.Open();
myCmd.ExecuteNonQuery();
myConn.Close();
}
提示什麼錯誤,是不是配置數據庫鏈接符有問題?yhzlConnectionString這個在配置環境是怎麼寫的