Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically populate DetailsView Control

Status
Not open for further replies.

sruvee

Programmer
Oct 11, 2007
5
0
0
US
Hi All,

I am using a DetailsView Control to get the data from a SQL Server table. I am using all the three operations (EDIT,DELETE,NEW) on the database table through DetailsView.
The primary key in the table is EmployeeID. My requirement is whenever user click on NEW, I want to get the maximum employee ID from table, and I want to increment it by 1. I would like to display this employee ID , whenever user wants to insert a new record. And also I want to make this text box read only. Where I have to put the code to do this task?
How can I achieve this?

Thanks & Happy new year to all of you

Sruvee
 
Even, if I use IDENTITY column in SQL table, I don't know how to bind this with the DetailsView ctrl's EmployeeID text box.
Could any body tell me how to do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top