Mike Eghtebas
asked on
c#, error: String or binary data would be truncated.
error: String or binary data would be truncated.
The data for table-valued parameter "@AnalyteTVP" doesn't conform to the table type of the parameter.
The statement has been terminated. 0
Create TYPE [dbo].[TVP_AnalyteData] AS TABLE(
[IDinAccess] char(7)
.
.
, ReportingLevel decimal(16,8) <---- please see c5 below
)
-------------------------- ---------- -
c# code:
string v1 = "";
if (temp != "")
v1 = temp.Substring(0, temp.IndexOf(" ")).Tr im();
if (Decimal.TryParse(v1.Repla ce(",", ""), out number))
c5 = number;
else
c5 = default(decimal?);
For @AnalyteTVP, see:
The data for table-valued parameter "@AnalyteTVP" doesn't conform to the table type of the parameter.
The statement has been terminated. 0
Create TYPE [dbo].[TVP_AnalyteData] AS TABLE(
[IDinAccess] char(7)
.
.
, ReportingLevel decimal(16,8) <---- please see c5 below
)
--------------------------
c# code:
string v1 = "";
if (temp != "")
v1 = temp.Substring(0, temp.IndexOf(" ")).Tr
if (Decimal.TryParse(v1.Repla
c5 = number;
else
c5 = default(decimal?);
For @AnalyteTVP, see:
Create PROCEDURE [dbo].[sp_InsertLabAnalyteData]
@AnalyteTVP TVP_AnalyteData READONLY
AS
BEGIN
--Select * From @AnalyteTVP;
-- multiple records of Anaylte data to AnalyteData table
INSERT INTO dbo.LabAnalyteData (
IDinAccess
.
.
, ReportingLevel
SELECT
IDinAccess
.
.
, ReportingLevel
FROM @AnalyteTVP;
Return @@Error
END
Here is LabAnalyteData table:
create table LabAnalyteData(
labAnalyteID int identity
, IDinAccess char(7)
.
.
, ReportingLevel decimal(16,8)
)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will keep you posted on the outcome.
Thanks,
Mike