Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am reading data from .csv file to data set, it look correct. Then i am transfer data from data set to table type for insert data into database. while i was saw query in profiler it show some invalid character in string.

Exa
SQL
declare @p2 int
set @p2=2
declare @p3 dbo.ACC_TYPE_NSE_DETAILS
insert into @p3 values(N'ZICOM',N'EQ',44.75,45,44.149999999999999,44.549999999999997,44.450000000000003,44.649999999999999,47912,2136669.1000000001,'2017-01-30 00:00:00',238,N'INE871B01014')
insert into @p3 values(N'ZODIACLOTH',N'EQ',196.5,196.5,186,188.05000000000001,188,189.15000000000001,346,65572.149999999994,'2017-01-30 00:00:00',37,N'INE206B01013')

declare @p4 dbo.ACC_TYPE_BSE_DETAILS
insert into @p4 values(532798,N'NTWK MED 
INV',N'A',N'Q',35.600000000000001,35.850000000000001,
35.299999999999997,35.700000000000003,
35˥649999999999999,35.649999999999999,200,25314,901523)
insert into @p4 values(600180,N'HDFC BANK LT',N'A',N'Q',1451.5,1475,1451.5,1462.8,1465,1474.9000000000001,289,61588,90032815)

exec INSERT_STOCK_PRICES @PRICE_DATE=N'1/30/2017 12:00:00 AM',@Result=@p2 output,@NSE_STOCK_DETAILS=@p3,@BSE_STOCK_DETAILS=@p4
select @p2


Does not able to find out any solution on it. Please do the needful.

I use WCF services for as database layer.

I have made invalid string in Italic and bold for our reference.

What I have tried:

I have tried add
MultipleActiveResultSets=True
in connection string.
Posted
Updated 6-Feb-17 0:03am
v4
Comments
dan!sh 6-Feb-17 3:33am    
What is the data type of that column?
Chetan Chopkar 6-Feb-17 6:05am    
data type of that column is Numeric (18,2)

1 solution

It looks like you want a decimal point instead of the "l". So that field should be "35.49999999999999". Check your csv file again.
 
Share this answer
 
v2
Comments
Chetan Chopkar 10-Feb-17 2:50am    
I had checked old as well as new csv file it seem to be corrected. Datatable also reflected corrected value. Issue occurred while transfered datatable to sql table type. data table contains near about 6000 no of rows.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900