Search:
Namespaces
Discussions
.NET v1.1
Feedback
Code to loop thru Access Table
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngdatagridrepeaterdatalist' list
.
Paul Chu
-- Moved from [aspngdata] to [aspngdatagridrepeaterdatalist] by eric landes <
Click here to reveal e-mail address
> --
Hi,
Can someone provide me with sample code to
Read an access 2000 table and loop thru and update each
Row and save the changes.
I would prefer an ASP.NET example using OLEDB.
I don't need the updating to occur thru a datagrid.
I want to massage the data in the table and then display thru a
datagrid.
Thanks, Paul
Reply to this message...
DavidW
How or in what form, are you proposing 'massaging' the data? Do you want
just a text box where you can input certain items and build the update
statement from there?
This is really WAY to vague a scenario.....anyway, the basic means of doing
the updating is an SQL Update statement - you create a connection to the
database, do the updating with the statement. Then, you can display it any
way you want in the datagrid. But, without knowing a little about your
needed scenario - and what needs updating - it's impossible to give an exact
answer.
These are the steps you'd need to do:
Create and open a database connection (tons of examples out there - even on
the site below)
Create a command that represents the SQL update statement
Execute the command - use ExecuteNonQuery() method
Like:
Dim con as
OleDbConnection
Dim strSQL as String
Dim cmdUpdate as
OleDbCommand
con=New
OleDbConnection
(connection string goes here)
strSQL="update table set fieldname='" & newdatagoes here & "' where
fieldname='" & whatevercriteriagoesHere & "'"
cmdUpdate=NewOledbCommand(strSQL,con)
cmdUpdate.ExecuteNonQuery()
con.close()
--
David Wier
http://aspexpress.com
Home of ASP Express - the best ASP text editor in the Galaxy
First editor with ASP.Net features
"Paul Chu" <
Click here to reveal e-mail address
> wrote in message
news:691713@aspngdatagridrepeaterdatalist...
[Original message clipped]
Reply to this message...
System.Data.OleDb.OleDbCommand
System.Data.OleDb.OleDbConnection
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com