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
 Development Tools
 ASP.NET
 stored proc, drag and drop problem in LINQ

Author  Topic 

ramsesiitr
Starting Member

22 Posts

Posted - 2008-11-25 : 06:37:22
Hi all,
First of all, I didn't know in where to open a topic about this. I thought this is the best place I can ask about my question.

I have an asp.net web site and I am using LINQ to retreive the records from SQL database. I can see the tables and stored procs in server explorer in .dbml file and I can drag and drop the tables and the stored procs without any problem but one of them. There is a stored proc, which returns three parameters, I can not drag and drop it into methods pane. When I do, it doesn not do anything. I try it with copying and pasting the proc into the methods pane, then it gives me this error:

"Index was outside the bounds of the array"

This doesnt make any sense to me. What array? What index?
Does anyone else encounter this problem?

I will be glad if you can help me.

PS: The proc is relatively longer then the other procs. But, I think, that shouldnt be a problem.

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-11-25 : 07:21:40
Index is either the starting point or ending point of an array.

An index always starts of with 0.

So if you array has 10 values, the values will be thus. For a csv example


mycsv = '1,2,3,4,5,6,7,8,9,10'

string[] myarray = mycsv.split(',');

each value can be gotten starting with the zero index ie to get the first you use

First value will be
Label1.Text = myarray[0].ToString();

the 10 value will be
Label1.Text = myarray[9].ToString();
Go to Top of Page

ramsesiitr
Starting Member

22 Posts

Posted - 2008-11-25 : 07:41:30
Thanks Africa but not relevant at all.

I dont have any array either in my code or in the proc. The problem sounds just stupid that when I drag the proc and drop it into the methods pane in my dbml file, I encounter that error I mentioned. Nothing else, I haven't even started coding...:((( It is not a run-time error or compile error.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-11-25 : 08:17:43
Oh sorry, My mistake

I prefer using the objectdatasource.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-25 : 08:17:54
Seems there is a bug with your tool.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -