현재 웹 기반 응용 프로그램의 트랜잭션을 완료하려고합니다. 문자열에서 매개 변수 값을 Int32로 변환하지 못했습니다.
다음은 기능의 사본 인 INT32
에 문자열에서 매개 변수 값을 변환하지 못했습니다.
public static void completeTransaction(string storeCode, string employeeId, DateTime Date, string itemListNoId)
{
using (SqlConnection conn = new SqlConnection("Data Source = ; Initial Catalog =Business ; Integrated Security = true;"))
{
using (SqlCommand command = new SqlCommand("dbo.completeTransaction", conn))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@storeCode", SqlDbType.Int).Value = storeCode;
command.Parameters.Add("@employeeId", SqlDbType.Int).Value = employeeId;
command.Parameters.Add("@Date", SqlDbType.DateTime).Value = Date;
command.Parameters.Add("@itemListNoId", SqlDbType.Int).Value = itemListNoId;
conn.Open();
command.ExecuteNonQuery();
conn.Close();
}
}
}
내 SQL Server 테이블은 어떤 도움을 주시면 감사하겠습니다 다음 표와 유형
storeCode INT
employee INT
Date DATETIME
itemListNoId INT
가 포함되어 있습니다. 나는 storeCode
문자열 상상
storeCode
employeeId
itemListNoId
: 입력의
문자열을 Int.32 데이터 형식으로 구문 분석해야합니다. –
제목 앞에 "C# SQL Server 2008"등의 접두어를 붙이지 마십시오. 그것이 바로 태그가있는 것입니다. –