.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

update grid view row

Posted By: kokulakrishnan     Posted Date: January 13, 2011    Points:2   Category :ASP.Net
hi all,can anyone explain how to use sql database table's auto generated column as a selection parameter in grid view.in my table there is a column with auto generated field.

Author: Manas Patnaik             
Posted Date: January 14, 2011     Points: 5   

I feel the question is not clear enough please elaborate it in detail .

Manas Patnaik
Author: kokulakrishnan             
Posted Date: January 14, 2011     Points: 5   

for an example, the table has three columns

according to my need i gave the employee_id as auto generated field. it means the id number is increasing by 1.when insert new data is inserted employee_id will increase by 1.my question is: how can i use the employee_id as a parameter to insert/update data in grid view.

Author: Manas Patnaik             
Posted Date: January 14, 2011     Points: 5   

I guess your Employee_Id is an Identity Column as well Primary Key , if so there should not be any issue .

Manas Patnaik
Author: Syed Shakeer Hussain             
Posted Date: January 15, 2011     Points: 5   

Hi kokulakrishnan,
If there is a Identity column in a Table then no need of calling identity column(Employee_Id) while using Insert Query
for example you can simply insert your data as follows:

Insert INTO TableName(employee_name,employee_age) VALUES('name1',20)

For updating write the query as follows:

Update TableName Set emplyee_name='ename2' Where employee_id=1

Author: kokulakrishnan             
Posted Date: January 17, 2011     Points: 5   

thank you all to help me. It is working

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend