Click here to Skip to main content
16,005,236 members
Home / Discussions / C#
   

C#

 
GeneralRe: File Streaming Pin
yoaz13-Oct-04 7:19
yoaz13-Oct-04 7:19 
GeneralResizing Individual Tabs on a TabControl Pin
dbromberg12-Oct-04 6:06
dbromberg12-Oct-04 6:06 
GeneralRe: Resizing Individual Tabs on a TabControl Pin
Heath Stewart12-Oct-04 11:12
protectorHeath Stewart12-Oct-04 11:12 
GeneralUpdate Command - Please Help Pin
amdacc12-Oct-04 3:16
amdacc12-Oct-04 3:16 
GeneralRe: Update Command - Please Help Pin
Colin Angus Mackay12-Oct-04 3:43
Colin Angus Mackay12-Oct-04 3:43 
GeneralRe: Update Command - Please Help Pin
amdacc12-Oct-04 9:22
amdacc12-Oct-04 9:22 
GeneralRe: Update Command - Please Help Pin
Colin Angus Mackay12-Oct-04 11:02
Colin Angus Mackay12-Oct-04 11:02 
GeneralRe: Update Command - Please Help Pin
Heath Stewart12-Oct-04 7:36
protectorHeath Stewart12-Oct-04 7:36 
It's good that you're trying to used parameterized queries since SQL string concatenation leaves you wide open for SQL injection attacks - which are especially bad in your case since your executing commands as the 'sa' - NEVER do this; always use least required privileges, especially when invoked from the most dangerous place on the planet: the Internet.

But you're not using parameters correctly. You should read the documentation for the SqlCommand.Parameters property in the .NET Framework SDK so you know what you're doing. Your SQL expression should actually look like this (based on your parameter names you're using):
DAUpdateCommand = new SqlCommand(@"
  UPDATE Items SET IPAddress = @IPAddress, Store = @Store, Ussage = @Ussage
  WHERE id = @ID");
BTW, it's "usage" with one "s", not "ussage".

Additionally, you'll need to add @ID to your parameters list. Always use parameterized queries everywhere possible.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: Update Command - Please Help Pin
amdacc12-Oct-04 9:27
amdacc12-Oct-04 9:27 
GeneralRe: Update Command - Please Help Pin
Colin Angus Mackay12-Oct-04 10:47
Colin Angus Mackay12-Oct-04 10:47 
GeneralRe: Update Command - Please Help Pin
2Scoops13-Oct-04 22:57
2Scoops13-Oct-04 22:57 
GeneralRe: Update Command - Please Help Pin
Heath Stewart12-Oct-04 10:56
protectorHeath Stewart12-Oct-04 10:56 
GeneralCrystal Reports Formulas Pin
NormDroid12-Oct-04 1:38
professionalNormDroid12-Oct-04 1:38 
GeneralRe: Crystal Reports Formulas Pin
Heath Stewart12-Oct-04 7:19
protectorHeath Stewart12-Oct-04 7:19 
GeneralRe: Crystal Reports Formulas Pin
NormDroid12-Oct-04 20:36
professionalNormDroid12-Oct-04 20:36 
GeneralSelect Statement Pin
pat27088112-Oct-04 1:26
pat27088112-Oct-04 1:26 
GeneralRe: Select Statement Pin
Stanciu Vlad12-Oct-04 2:24
Stanciu Vlad12-Oct-04 2:24 
GeneralRe: Select Statement Pin
Heath Stewart12-Oct-04 7:13
protectorHeath Stewart12-Oct-04 7:13 
GeneralRe: Select Statement Pin
Mike Dimmick12-Oct-04 2:47
Mike Dimmick12-Oct-04 2:47 
GeneralRe: Select Statement Pin
pat27088112-Oct-04 3:14
pat27088112-Oct-04 3:14 
GeneralRe: Select Statement Pin
Colin Angus Mackay12-Oct-04 3:21
Colin Angus Mackay12-Oct-04 3:21 
GeneralRe: Select Statement Pin
pat27088112-Oct-04 3:45
pat27088112-Oct-04 3:45 
GeneralRe: Select Statement Pin
Heath Stewart12-Oct-04 7:17
protectorHeath Stewart12-Oct-04 7:17 
GeneralRe: Select Statement Pin
pat27088112-Oct-04 7:36
pat27088112-Oct-04 7:36 
GeneralRe: Select Statement Pin
Heath Stewart12-Oct-04 7:52
protectorHeath Stewart12-Oct-04 7:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.