데이터베이스 테이블에 데이터를 삽입 할 때 데이터의 첫 글자 만 데이터베이스의 열에 삽입됩니다.
다음은 데이터베이스 테이블입니다.
직원 ID : 102의 경우 데이터의 첫 글자 만 삽입됩니다. 이것은이다 표 스키마는 데이터베이스 사용.
내 프로젝트에 Visual Studio Community 2015 및 SQL Server Studio Management Studio에서 C #을 사용하고 있습니다.
using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TimeSheetApp
{
class Program
{
static void Main(string[] args)
{
string connection = ConfigurationManager.ConnectionStrings["TimeSheetAppDbConnectionString"].ToString();
var dbcontext = new TimeSheetAppDesignDataContext(connection);
int EmployeeID = 102;
string EmployeeName = "Riyas", EmployeeEmailAddress = "[email protected]", EmployeeLocation = "SriLanka";
dbcontext.insertEmployee(EmployeeID, EmployeeName, EmployeeEmailAddress, EmployeeLocation);
Console.WriteLine("Data inserted successfully");
Console.ReadLine();
}
}
}
누구든지이 오류를 해결하도록 친절하게 도와줍니다.
데이터를 올바르게 전달하고 있고 데이터베이스 구조가 정확합니다. 오류를 찾는 마지막 단서는 절차를 확인하는 것입니다 insertEmployee
. 오류는 절차에 있으며 대부분 매개 변수 유형에 있습니다.
해당 절차에 대한 매개 변수 정의를 확인하십시오. 당신이 사용하는 경우 NVARCHAR
길이를 지정하지 않고의 기본이 때문에, 데이터는 하나의 문자로 절단되고 NVARCHAR
있다NVARCHAR(1)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다