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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bind a TextBox to result of SQL query in an InsertItemTemplate

Status
Not open for further replies.

monkeymagic2222

Technical User
May 13, 2002
78
GB
Hi,

Is it possible to bind a TextBox in an InsertItemTemplate to the results of an SQL Query?

All I want to do is insert a new record into a database (using DetailsView) but I want the first textbox (FleetNo) to automatically be populated with the result of another sql query (all it does is a max of the FleetNo field and adds one to it).

Now I know I could do this automatically with SQL by setting Identity to on but I need to be able to give the user extra flexibility as theres the chance the FleetNo won't always be the next available number.

I am using VB.NET and Visual Studio 2005.

Thanks in anticipation!
 
The best thing to do is not allow the user to specify and and ID or in your case the FleetNO which I assume you are using as an ID. If you are using SQL Server use an identity column., and don't even show the ID to the user.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top