테스트 목적으로 널을 허용하는 모든 열이있는 데이터베이스 테이블이 있습니다. 내 모든 컬럼 사이에 int, varchar 또는 bit 데이터 유형이 있습니다. 내가 양식을 제출하려고 할 때 다음과 같은 오류 메시지가 : 여기 linq to sql 삽입 오류 도움말
Value was either too large or too small for an Int32.
코드입니다 :
using (storeDataContext db = new storeDataContext())
{
db.Dealerssses.InsertOnSubmit(new Dealersss
{
AppFName = txtFName.Text,
AppLName = txtLName.Text,
AppTitle = ddlTitles.SelectedItem.Text,
AppPhone = Convert.ToInt32(txtPhone.Text),
AppEmail = txtEmail.Text,
AppAddress = txtAddress.Text,
AppCity = txtCity.Text,
AppState = txtState.Text,
AppZip = Convert.ToInt32(txtZip.Text),
BusName = txtBusName.Text,
BusCA = Convert.ToInt32(txtBusResale.Text),
BusContact = txtBusContact.Text,
BusDBA = txtDBA.Text,
BusEIN = Convert.ToInt32(txtBusEIN.Text),
BusEmail = txtBusEmail.Text,
BusFax = Convert.ToInt32(txtBusFax.Text),
BusMonth = ddlMonthStart.SelectedItem.Text,
BusNumEmployees = Convert.ToInt32(txtBusEmployees.Text),
BusPhone = Convert.ToInt32(txtBusPhone.Text),
BusYear = int.Parse(txtYearStart.Text),
Active = false
});
db.SubmitChanges();
};
오류를 읽고 계셨습니까? – SLaks
@slaks의 경우 폼에 게시되는 값은 1에서 15 자리 사이이므로 int32의 경우 너무 큰 값을 사용할 수 없습니다. –
코드가 유효한 우편 번호 07055를 엉망으로 만들 것입니다. ** 숫자가 아닌 데이터를 정수 열에 저장하지 마십시오! ** – SLaks