TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ben.kimball
NA
9
0
Relearning old ASP/ODBC tricks
May 17 2004 1:57 PM
Can someone show me the "new way" to do the following (old ASP/ADO code shown) with ASP.NET/ADO.NET? This was opening a table and adding a new row without using any actual SQL SELECT/UPDATE statements. Thanks! <% 'Get data from Request object SendTo = Request.Form("PID") Message = Request.Form("Message") 'Open database connection Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.Open "DSN=dataBaseName;uid=someUid;pwd=xxxx" 'Attach to XMessage table in database Set rsXMessage = CreateObject("ADODB.Recordset") rsXMessage.Open "XMessages", dbConn, adOpenKeySet, adLockOptimistic 'Add new row to table rsXMessage.AddNew 'Set row data rsXMessage("XTo") = SendTo rsXMessage("XFromID") = Session("ID") rsXMessage("XFromName") = Session("Name") rsXMessage("SentWhen") = Now rsXMessage("Message") = Message 'Commit/Update changes to row data rsXMessage.Update 'Close database connection rsXMessage.Close %>
Reply
Answers (
2
)
Dataset Relations within the same table ... seeking advice
Huge table needs to be loaded