|
-
March 7th, 2003, 12:09 AM
#1
Updating data in a database
I have a problem which I believe should be easy for most programmers, but I cannot find the answer to it in any of the Microsoft Course manuals that I have (ADO.NET & Web Develeopment Technologies) nor I can I find it on the web.
I have created a webform with textboxes (ASP:textbox) and want the information that the user inputs in it to add to a table in a microsoft access database. (future attempts will be to modify and delete)
If anyone can direct me in the right direction or send me sample code I would really appreciate it.
Thank you
Bernhard
-
March 9th, 2003, 02:28 AM
#2
hey!
u will hav to make a bridge b/w ur application n ur database! through which u will carry out your data manipulation queries.
if ur backend is sql server! then here is the same code,
i hav implemented this in a class! just adjust it.....
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Dim strConnection As String = "user id=sa;password=;"
public sub update(string as SqlQuery) strConnection+= "Database=yourdatabasename;server=yourservername;"
strConnection += "Connect Timeout=30"
Dim objConnection As New SqlConnection(strConnection)
Dim objCommand As New SqlCommand(SqlQuery,objConnection)
objConnection.Open()
objCommand.ExecuteReader()
objConnection.Close()
end sub
i am sending the sqlQuery as input to this procedure. eg for sqlQuery can be "Update Employee set EmployeeName='Tony' where EmployeeNumber=1419"
hope it helps ur cause!
cya
addy
KnowLedge is Power
-
March 9th, 2003, 08:20 AM
#3
Thank you for your reply. My problem is that I am needing to integrate with MS Access. Whereever you have a command for SQL, should I change that to OleDB ??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|