473,418 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

update gridview with stored procedure??

i am using this stored procedure to update my gridview
Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE [dbo].[updatestdnt]
  2. @Name varchar(20),
  3. @Course varchar(20),
  4. @Age numeric,
  5. @Sex varchar(20),
  6. @DateofBirth datetime,
  7. @Address  varchar(20),
  8. @Contactno numeric,
  9. @Email varchar(20),
  10. @studentid varchar(10),
  11. @password varchar(10)
  12. AS
  13. UPDATE Student SET
  14. Name=@Name ,
  15. Course=@Course,
  16. Age=@Age,
  17. Sex=@Sex,
  18. DateofBirth=@DateofBirth,
  19. Address=@Address,
  20. Contactno=@Contactno,
  21. Email=@Email,
  22. studentid=@studentid,
  23. password=@password
  24. where Contactno=@Contactno
  25.  
but the Name after
UPDATE Student SET statement
appers in blue and wen i try to run this procedure in my website it says the name parameter has not been supplied?? is the procedure wrong as Name appears in blue??
and in where clause i used Contactno because its the primary key..is this where method correct??
Apr 1 '10 #1

✓ answered by Delerna

try putting name in square brackets
Expand|Select|Wrap|Line Numbers
  1. ........
  2. UPDATE Student SET 
  3. [Name]=@Name , 
  4. ...........
  5.  
name is a function that
Returns the name of a level, dimension, member, or hierarchy.
that's why it is blue

To use a function name as a field name you must explicitly identify it as a field name
with [] otherwise it will be treated as a fuction and generate an error

1 2820
Delerna
1,134 Expert 1GB
try putting name in square brackets
Expand|Select|Wrap|Line Numbers
  1. ........
  2. UPDATE Student SET 
  3. [Name]=@Name , 
  4. ...........
  5.  
name is a function that
Returns the name of a level, dimension, member, or hierarchy.
that's why it is blue

To use a function name as a field name you must explicitly identify it as a field name
with [] otherwise it will be treated as a fuction and generate an error
Apr 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dorte | last post by:
Hi, I use the gridview control to display data. I use a dataadapter to fill a datatable from an SQL server - the command is a stored procedure. Furthermore I have a couple of template columns...
0
by: Mike P | last post by:
Where exactly are the updateparameters of a gridview picked up from? I have created 2 very similar gridviews and given the updateparameters the same names as in my edititemtemplates. Yet this...
3
by: Richard Carpenter | last post by:
I have a simple winform with a customers combobox, a "get orders" button and an orders grid. Due to other requirements, I have implemented the form to allow the user to select a customer from the...
0
by: et | last post by:
I set up a gridview to update according to a stored procedure. The parameters in the gridview <UpdateParametersare exactly the same as the parameters in the stored procedure, yet I receive the...
0
by: troyblakely | last post by:
I have a gridview which is pulling data from a SqlDataSource, the select command queries a view and the update command is a stored procedure. I'm using a stored procedure because several tables...
4
by: Wannabe | last post by:
I am using ASP.Net 2.0 and have a gridview on my page. I have everything working except the delete command. The page reloads except the row I am trying to delete is still there. I believe it is...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
0
by: Hurricane | last post by:
I have my SQL database with a table that I am trying to have a gridview dislay with inline editing. It seems as if the dataset does not generate the apropriate update query, and therefore...
0
by: Looch | last post by:
All, I'm using the GridView wizard to generate an Update statement based on the select statement that fills the GridView. I have since created a stored procedure that I'd rather use and when I...
25
by: premprakashbhati | last post by:
i want to have checkboxes in my gridview ...by checking it ,i can delete the row/rows.... so i have written code and got 2 Errors ...can anyone solve it... Error:1...'gridview.RetrieveItems()': not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.