"INSERT INTO Fn_Registration VALUES ('+ txtFirstName.Text +"', "txtLastName.Text +" ', "+"' "+ txtEmailId.Text + "+"txtAddress1.Text + " ',"+ "'"+ "txtAddress2"+ "txtPassword.Text +", "+" 텍스트 + ","+ " '"+ txtFaxNo.Text + "',"+ " '"+ txtFirmName.Text + "',"+ " '"+ txtPhoneNumber.Text + "',"+ " "txtAccountsEnd.Text +" ', + "cbbVat.Text +"', "+" ' "+ cbbstates.Text +"', txtTinNumber.Text + " ' "+" '+ txtCity.Text + "', +"txtBankName.Text + " ',"+ txtAccountNumber.Text + "',"+ " '"+ txtIFSCCode.Text + "',"+ " ' "+"txtBN1.Text + " ',"+ "'+ txtAC1.Text +" ', "+" " '+ txtAC2.Text +"', "+" ' "+ txtIFSC2.Text +"') ";mysql에 자동 증가를 적용 할 수 없습니다.
아이디 NUM은 MySQL의 doesnot 자동 increamented 수 ,,,해야하지만 이곳이 MySQL 데이터베이스로 내 삽입 코드가 자동 점진을 수행하는 하나 개의 도움 .........
C# 코드는 수 당신의 삽입 쿼리에서
string regInset = "INSERT INTO Fn_Registration VALUES ('" + 101 + "', '"+
txtFirstName.Text + "', '" + txtLastName.Text + "', " + " '" + txtEmailId.Text +
"', " + " '" + txtPassword.Text + "', " + " '" + txtPanNumber.Text + "', " + " '" +
txtAddress1.Text + "', " + " '" + txtAddress2.Text + "', " + " '" + txtFaxNo.Text +
"'," + " '" + txtFirmName.Text + "', " + " '" + txtPhoneNumber.Text + "', " + " '"
+ txtTinNumber.Text + "','" + txtAccountsStart.Text + "','" + txtAccountsEnd.Text +
"','" + cbbVat.Text + "', " + " '" + cbbstates.Text + "', " + " '" + txtCity.Text +
"', '" + txtBankName.Text + "', '" + txtAccountNumber.Text + "', " + " '" +
txtIFSCCode.Text + "', " + " '" + txtBN1.Text + "', " + " '" + txtAC1.Text + "', " +
" '" + txtIFSC1.Text + "', " + " '" + txtBN2.Text + "', " + " '" + txtAC2.Text + "', "
+ " '" + txtIFSC2.Text + "')";
cmd = new MySqlCommand(regInset, con);
da = new MySqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds, "Fn_Registration");
this.clearData();
후 귀하의'C#을 '코드를! –
쿼리를 작성하고 매개 변수를 직접 전달하지 마십시오. 이는 잘못된 표준 중 하나입니다. 귀하의 질문에 대답하기 위해 ID를 데이터베이스의 ID 열로 언급해야합니다. 여기서는 구성 할 필요가 없습니다. – codebot
어떤 열을 자동 증가시켜야합니까? 101을 넣은 곳? 또는 다른 어떤? 자동 증가로 설정 했습니까? –