Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 startIndex cannot be larger than length of string

Author  Topic 

s2002
Starting Member

49 Posts

Posted - 2009-12-18 : 03:44:51
hi,
recently I restored DB in to new sql server, Now when I try to udate/insert in to new SQL server using .Net , I encounter following error

startIndex cannot be larger than length of string.
Parameter name: startIndex

I don't think it's related to Progrmamming, since I could insert/update to Old SQL server.

sincerely,

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-18 : 03:49:04
Hi

May be this one

You are getting this error because the startindex you are passing is greater than the length of string. For example:

"Test".IndexOf("T", 12)

will generate the same exception. You must pass the startindex parameter less than the length of the string.

-------------------------
R...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-18 : 04:15:23
Can you post the code you used?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

s2002
Starting Member

49 Posts

Posted - 2009-12-18 : 05:48:50
thank rajdaksha
it's solved
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-18 : 05:52:02
Welcome...

-------------------------
R...
Go to Top of Page
   

- Advertisement -