Hi all, i am having problems updateing images to db, the insert statement works fine. this is my code - command = new SqlCommand("UPDATE ITEMS SET IMG_NAME='@img_name', IMG_DATA='@img_data', IMG_CONTENTTYPE='@img_contenttype', NAME='@name', CATEGORY='@cat', PRICE='@price', DERSCIPTION='@desc', QUANTITY='@quant' WHERE IMG_PK='@imgId'", connection);
-
-
-
SqlParameter param0 = new SqlParameter("@img_name", SqlDbType.VarChar, 50);
-
param0.Value = imgName;
-
command.Parameters.Add(param0);
-
-
SqlParameter param1 = new SqlParameter("@img_data", SqlDbType.Image);
-
param1.Value = imgBinaryData;
-
command.Parameters.Add(param1);
-
-
SqlParameter param2 = new SqlParameter("@img_contenttype", SqlDbType.VarChar, 50);
-
param2.Value = imgContentType;
-
command.Parameters.Add(param2);
-
-
SqlParameter param3 = new SqlParameter("@name", SqlDbType.VarChar, 50);
-
param3.Value = szName;
-
command.Parameters.Add(param3);
-
-
SqlParameter param4 = new SqlParameter("@cat", SqlDbType.Int);
-
param4.Value = iCat;
-
command.Parameters.Add(param4);
-
-
SqlParameter param5 = new SqlParameter("@price", SqlDbType.Decimal);
-
param5.Value = dPrice;
-
command.Parameters.Add(param5);
-
-
SqlParameter param6 = new SqlParameter("@desc", SqlDbType.VarChar, 300);
-
param6.Value = szDesc;
-
command.Parameters.Add(param6);
-
-
SqlParameter param7 = new SqlParameter("@quant", SqlDbType.Int);
-
param7.Value = iQuantity;
-
command.Parameters.Add(param7);
-
-
SqlParameter param13 = new SqlParameter("@imgId", SqlDbType.VarChar, 25);
-
param13.Value = szImgIdNew;
-
command.Parameters.Add(param13);
-
-
-
-
-
connection.Open();
-
numRowsAffected = command.ExecuteNonQuery();
-
connection.Close();
* numRowsAffected always returns 0 i checked there are no null values, thanks for your help
1 1767
Display the entire SQLCommand in a window. Copy that command and paste it on a query analyzer and execute it.
See if it executes properly. We'll go from there....
Good Luck!!!
~~ CK
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mudcat |
last post by:
I have an image that displays on a canvas that works unless I put the
same code in a class. I can't figure that out. Here's what works:
def uts5100(self):
self.screen = Toplevel( self.master )...
|
by: brenny |
last post by:
I'm saving image to any folder(no write,read permisions) by using
image1.save method.
I have accomplished this but I want to update this image,I want to change
this image with another image or...
|
by: johnnymack0730 |
last post by:
Hello -
I am currently working on an asp.net application that needs to be able
to update an access table using ExecuteNonQuery method. I have all the
code setup, it runs, there are no errors...
|
by: HydroSan |
last post by:
Having a bit of a problem getting UPDATE working. The project in
question is a simple MySQL VB.NET frontend, allowing Insertion,
Selection, and others.
Well, I've gotten Drop and Insert working,...
|
by: stahl.karl |
last post by:
I am trying to update an image when I load a page, then perform a bunch
of other actions that take a while. The problem is that the image does
not update until the entire function has finished...
|
by: loga123 |
last post by:
Hi All,
I am using asp.net 2.0. I have a gridview where I want to update a row
value on clicking 'UPDATE" buttomn.
I have set up sqlDataSource and UPDATE statement. When I click on
UPDATE, it...
|
by: qatarya3sal |
last post by:
Imports System.XML
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
...
|
by: jas16183 |
last post by:
Hi Guys,
need some help here,
Im working on a project in vb.net, the problem im facing is that my tableadapter.update(dataset.datatable) is not functioning,
the datatable has a relation with...
|
by: nthaka1 |
last post by:
Hi,
I have used one HTMLEditor user control in which iframe and textarea are used.
I had uploaded my html page in that editor and trying to edit html page. In this I want to give facility like...
|
by: fishnfrogs |
last post by:
Hi, I can't figure out why this isn't working. I'm trying to loop through an array and do a mysql update. However, it doesn't work.
for($i = 0; $i < $len; ++$i)
{
$param = $array . '%';...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |