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

SQL in aspx using javascript

Status
Not open for further replies.

dumbdum

IS-IT--Management
Aug 8, 2006
1
CA
Hi,
In my asp page using javascript, I add some data to an SQL Table using .addnew().
for example:

var sql1 = "INSERT INTO Table (LI, LoI) VALUES('" + yco + "', '" + xco + "') SELECT @@IDENTITY";

var result1 = connection.Execute(sql1);

newID3 = result1.Fields(0).value;
-----
I can't get a value for the ID in the SQL Table.
Anybody have any suggestions?
 
if i remember correctly, i used to do it like so:
Code:
var sql1 = "INSERT INTO Table (LI, LoI) VALUES('" + yco + "', '" + xco + "')[highlight];[/highlight] SELECT @@IDENTITY";

var result1 = connection.Execute(sql1);
[!]result1.nextRecordset();[/!]

newID3 = result1.Fields(0).value;

-jeff
lost: one sig, last seen here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top