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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2007, 02: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)

conn.Open()

cmd.ExecuteNonQuery()

End Using

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

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
Reply

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
How to execute SQL queries for Plesk database? Speedy ASP.NET Hosting Control Panels 1 07-10-2008 06:08 PM
manage SQL Server 2005 database Gambler SQL Server 1 03-27-2008 05:14 PM


All times are GMT. The time now is 04:33 AM.


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

Managed Dedicated and Cloud Windows Hosting