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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-28 : 08:15:07
|
| Si writes "Hey there. Im having a bit of trouble it seems writing a stored proc. What im trying to do is take some info (First+Last Names) from a table on my DB and insert them into corresponding textboxes on my webform.Eg. @LastName->this.txtLastName.text @FirstName->this.txtFirstName.text etc...Im using a DDL which has all the names in, and when you select a teacher their names will appear in the text boxes. Currently my stored proc returns with the error, "Stored Procedure 'GetTutorDetails' expects parameter '@LastName'"This is my stored Proc. create Procedure GetTutorDetails(@PK int,@LastName varchar(20),@FirstName varchar(20))AsSelect LastName=@LastName, FirstName=@FirstNameFrom Tutorswhere PKTutor=@PKCan you see where im going wrong or not?Hope to hear soon, si" |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2005-10-28 : 08:18:46
|
If you are trying to return the first name and the last name, then you do not need to define them in the param list. Only if they are a parameter of the query should they be up there... if they are params, but not required, then put '= null' after each one thats not required...My guess at what you need:create Procedure GetTutorDetails@PK intAsSelect LastName, FirstNameFrom Tutorswhere PKTutor=@PKCorey Co-worker on children "...when I have children, I'm going to beat them. Not because their bad, but becuase I think it would be fun ..." |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-28 : 09:00:57
|
| orWhen you run your procedure you need to supply value for @LastName parameterMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|