Go Back   Windows Hosting Forums > ASP.NET Hosting Data > Access Database

Access Database All about using Access as database in your asp.net applications.

Affordable Windows VPS Hosting

Thread Tools Display Modes
Old 11-30-2007, 03:09 PM
m0foWnz0R m0foWnz0R is offline
Junior Member
Join Date: Nov 2007
Posts: 3
Default Database Value

I'm trying to get a value from an access database,that value being a number and add it to another number then update the database.I'm having troubles with "OldCount".

Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\My Data.mdb"

Dim SqlString As String = "Update FullAppDetails Set Downloaded = ?"
Dim NewCount As Integer = 1

Dim OldCount As Integer = <%# Eval("Downloaded") %>
Dim i As Integer = CInt(NewCount + oldcount)

Using conn As New OleDbConnection(ConnString)
Using cmd As New OleDbCommand(SqlString, conn)

cmd.CommandType = Data.CommandType.Text
cmd.Parameters.AddWithValue("Downloaded", i)



End Using

End Using
Reply With Quote
Old 12-01-2007, 09:24 AM
majk majk is offline
Junior Member
Join Date: Nov 2007
Posts: 4

Hmm,seems to me you are trying to add 1 to an existing value in a column so here is what i suggest :

Update FullAppDetails Set Downloaded = Downloaded + 1 Where
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I install MS SQL Server 2005 database on MS SQL Server 2008? banker SQL Server 1 10-25-2008 07:33 AM
manage SQL Server 2005 database Gambler SQL Server 1 03-27-2008 05:14 PM

All times are GMT. The time now is 04:51 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.

Managed Dedicated and Cloud Windows Hosting