[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2236
  • Last Modified:

System.ArgumentOutOfRangeException = Index and length must refer to a location within the string

[System.ArgumentOutOfRangeException]      {"Index and length must refer to a location within the string.\r\nParameter name: length"}      System.ArgumentOutOfRangeException

Here is the sql statement:

"insert into ImportedData (BatchID, Date, Clientip, Firstname, Zip, Email) values ('20100104145312', 'April 20, 2009, 8:17 pm', '72.135.252.110', 'Rene\\''', 'Webster', 'twebster3@wi.rr.com')"


Strange, cuz when I try to run this in My-SQLFront --- it runs with no problems.

I think maybe it has something to do with what is trying to go into Firstname column --  Rene\\

but not sure how to fix.




Thank you,


Tom
0
Tom Knowlton
Asked:
Tom Knowlton
1 Solution
 
zadeveloperCommented:
your date format is incorrect - remove the commas
(I have purposefully used the replace function so you can use it on a varchar variable)
 

insert into ImportedData (BatchID, Date, Clientip, Firstname, Zip, Email) values ('20100104145312', replace('April 20, 2009, 8:17 pm', ',', ''), '72.135.252.110', 'Rene\\''', 'Webster', 'twebster3@wi.rr.com')

Open in new window

0
 
Tom KnowltonWeb developerAuthor Commented:
thx!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now